Skip to content

Commit

Permalink
Do no boot scheduler unless the package is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
turbo124 committed Mar 23, 2021
1 parent 2f38612 commit d48227f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/CollectorServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}
}
}

0 comments on commit d48227f

Please sign in to comment.