Skip to content

Commit

Permalink
Merge pull request #116 from Propaganistas/patch-1
Browse files Browse the repository at this point in the history
don't write to horizon config when not available
  • Loading branch information
freekmurze authored Dec 16, 2024
2 parents 7f96c75 + 2a111ec commit 0b3b6d5
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 0b3b6d5

Please sign in to comment.