Skip to content

Commit

Permalink
Fix for breakage if snooze disabled but pruneAge set (#89)
Browse files Browse the repository at this point in the history
Co-authored-by: atymic <[email protected]>
  • Loading branch information
ricuss and atymic authored Sep 10, 2021
1 parent f927556 commit b8d523c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ public function boot()
{
// Schedule base command to run every minute
$this->app->booted(function () {

//Ensure the schedule is available if snooze is disabled but a prune age is set
$schedule = $this->app->make(Schedule::class);

if (! config('snooze.disabled')) {
$frequency = config('snooze.sendFrequency', 'everyMinute');
$schedule = $this->app->make(Schedule::class);

if (config('snooze.onOneServer', false)) {
$schedule->command('snooze:send')->{$frequency}()->onOneServer();
} else {
Expand Down

0 comments on commit b8d523c

Please sign in to comment.