Permalink
Browse files

fix scheduler option for Windows servers

  • Loading branch information...
laurencei committed Feb 22, 2018
1 parent c95b0d8 commit f4fa90dc976c410475580fbb6da8f5873782496f
Showing with 20 additions and 4 deletions.
  1. +4 −4 app/EyeServiceProvider.php
  2. +16 −0 config/eyewitness.php
@@ -153,7 +153,7 @@ protected function loadEyewitnessSchedules()
$this->app->booted(function () {
$schedule = $this->app->make(Schedule::class);
if ($this->eye->laravelVersionIs('>=', '5.2.32')) {
if ($this->eye->laravelVersionIs('>=', '5.2.32') && config('eyewitness.enable_scheduler_background')) {
$schedule->command('eyewitness:poll')->cron('* * * * *')->runInBackground();
$schedule->command('eyewitness:custom')->cron('* * * * *')->runInBackground();
$schedule->command('eyewitness:prune')->cron('56 1 * * *')->runInBackground();
@@ -164,7 +164,7 @@ protected function loadEyewitnessSchedules()
}
if (config('eyewitness.monitor_ssl')) {
if ($this->eye->laravelVersionIs('>=', '5.2.32')) {
if ($this->eye->laravelVersionIs('>=', '5.2.32') && config('eyewitness.enable_scheduler_background')) {
$schedule->command('eyewitness:monitor-ssl')->cron($this->eye->getMinuteSeed(1).' * * * *')->runInBackground();
$schedule->command('eyewitness:monitor-ssl --result')->cron($this->eye->getMinuteSeed(31).' * * * *')->runInBackground();
} else {
@@ -174,15 +174,15 @@ protected function loadEyewitnessSchedules()
}
if (config('eyewitness.monitor_dns')) {
if ($this->eye->laravelVersionIs('>=', '5.2.32')) {
if ($this->eye->laravelVersionIs('>=', '5.2.32') && config('eyewitness.enable_scheduler_background')) {
$schedule->command('eyewitness:monitor-dns')->cron($this->eye->getMinuteSeed(10).' * * * *')->runInBackground();
} else {
$schedule->command('eyewitness:monitor-dns')->cron($this->eye->getMinuteSeed(10).' * * * *');
}
}
if (config('eyewitness.monitor_composer')) {
if ($this->eye->laravelVersionIs('>=', '5.2.32')) {
if ($this->eye->laravelVersionIs('>=', '5.2.32') && config('eyewitness.enable_scheduler_background')) {
$schedule->command('eyewitness:monitor-composer')->cron($this->eye->getMinuteSeed(20).' '.$this->eye->getHourSeed().' * * *')->runInBackground();
} else {
$schedule->command('eyewitness:monitor-composer')->cron($this->eye->getMinuteSeed(20).' '.$this->eye->getHourSeed().' * * *');
@@ -173,6 +173,22 @@
'eyewitness_database_connection' => env('EYEWITNESS_DATABASE_CONNECTION', null),
/*
|--------------------------------------------------------------------------
| Allow scheduler to run Eyewitness tasks in background
|
| https://docs.eyewitness.io/configuration/general#eyewitness-scheduler-background-tasks
|--------------------------------------------------------------------------
|
| This should only be changed if you run Laravel & Eyewitness on a Windows server and
| experience issues with your schedules not running correctly. This is caused by some
| inconsistencies in how Window servers handles background processes. Only in this
| specific situation should you make the following change.
|
*/
'enable_scheduler_background' => true,
/*
|--------------------------------------------------------------------------
| Web route middleware

0 comments on commit f4fa90d

Please sign in to comment.