You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is just a general question. Today I figured out that the event "BackupWasSuccessful" only gets triggered if the option --disable-notifications is not set.
I've used the following in app/Console/Kernel.php: $schedule->command('backup:run --disable-notifications')->hourlyAt(55);
And I added this option because I do not want to be notified every hour that it was successful. However, I've created my own Listener to check if the event "BackupWasSuccessful" was triggered to call a script which does a rsync on a lots of data.
However, if the option to disable notifications is set, this event does not trigger, hence my listener is not able to do the rsync.
I can see in Tasks/Backup/BackupJob.php, the method $this->sendNotification(new BackupWasSuccessful($backupDestination)); is called, but in this method, there is a check whether to send or not.
To finally come to my question:
Why is the event firing relying on if notifications are to be send or not? The backup was successful anyways. My workaround now is to specify teams as notification (which is not supported), an error gets thrown but at least the event is fired again.
Is this on purpose? Is my logical thinking wrong? What am I overseeing?
For me it would make more sense to split it, e.g. a Listener to check if the the event "BackupWasSuccessful" was triggered and then do the notification stuff (based on the option whether to send or not).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is just a general question. Today I figured out that the event "BackupWasSuccessful" only gets triggered if the option
--disable-notifications
is not set.I've used the following in
app/Console/Kernel.php
:$schedule->command('backup:run --disable-notifications')->hourlyAt(55);
And I added this option because I do not want to be notified every hour that it was successful. However, I've created my own Listener to check if the event "BackupWasSuccessful" was triggered to call a script which does a rsync on a lots of data.
However, if the option to disable notifications is set, this event does not trigger, hence my listener is not able to do the rsync.
I can see in Tasks/Backup/BackupJob.php, the method
$this->sendNotification(new BackupWasSuccessful($backupDestination));
is called, but in this method, there is a check whether to send or not.To finally come to my question:
Why is the event firing relying on if notifications are to be send or not? The backup was successful anyways. My workaround now is to specify teams as notification (which is not supported), an error gets thrown but at least the event is fired again.
Is this on purpose? Is my logical thinking wrong? What am I overseeing?
For me it would make more sense to split it, e.g. a Listener to check if the the event "BackupWasSuccessful" was triggered and then do the notification stuff (based on the option whether to send or not).
Beta Was this translation helpful? Give feedback.
All reactions