Skip to content

Commit

Permalink
don't write to horizon config when not available
Browse files Browse the repository at this point in the history
  • Loading branch information
Propaganistas authored Dec 13, 2024
1 parent 7f96c75 commit 2a111ec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ScheduleMonitorServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Console\Events\CommandStarting;
use Illuminate\Console\Scheduling\Event as SchedulerEvent;
use Illuminate\Support\Facades\Event;
use Laravel\Horizon\Horizon;
use OhDear\PhpSdk\OhDear;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
Expand Down Expand Up @@ -88,6 +89,10 @@ protected function silenceOhDearJob(): self
return $this;
}

if (! class_exists(Horizon::class)) {
return $this;
}

$silencedJobs = config('horizon.silenced', []);

if (in_array(PingOhDearJob::class, $silencedJobs)) {
Expand Down

0 comments on commit 2a111ec

Please sign in to comment.