From d48227fdfafc463cce055f36b149f9cb1d9b8f81 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 23 Mar 2021 20:54:29 +1100 Subject: [PATCH] Do no boot scheduler unless the package is enabled --- src/CollectorServiceProvider.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/CollectorServiceProvider.php b/src/CollectorServiceProvider.php index 93e05c3..b88bac7 100644 --- a/src/CollectorServiceProvider.php +++ b/src/CollectorServiceProvider.php @@ -43,11 +43,13 @@ public function register() return new Collector; }); - /* Register the scheduler */ - $this->app->booted(function () { - $schedule = app(Schedule::class); - $schedule->job(new BatchMetrics())->everyFiveMinutes(); - }); - + if(config('beacon.enabled')) + { + /* Register the scheduler */ + $this->app->booted(function () { + $schedule = app(Schedule::class); + $schedule->job(new BatchMetrics())->everyFiveMinutes(); + }); + } } }