diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 881c9eacc618..02a3bcb373bc 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -23,6 +23,7 @@ use App\Jobs\Util\SchedulerCheck; use App\Jobs\Util\SendFailedEmails; use App\Jobs\Util\UpdateExchangeRates; use App\Jobs\Util\VersionCheck; +use App\Models\Account; use App\Utils\Ninja; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; @@ -69,6 +70,10 @@ class Kernel extends ConsoleKernel $schedule->job(new SchedulerCheck)->daily()->withoutOverlapping(); + $schedule->call(function () { + Account::whereNotNull('id')->update(['is_scheduler_running' => true]); + })->everyFiveMinutes()->withoutOverlapping(); + /* Run hosted specific jobs */ if (Ninja::isHosted()) { diff --git a/app/Jobs/Util/SchedulerCheck.php b/app/Jobs/Util/SchedulerCheck.php index 20c54ff4708d..409478ca016f 100644 --- a/app/Jobs/Util/SchedulerCheck.php +++ b/app/Jobs/Util/SchedulerCheck.php @@ -38,8 +38,6 @@ class SchedulerCheck implements ShouldQueue { set_time_limit(0); - Account::whereNotNull('id')->update(['is_scheduler_running' => true]); - if(config('ninja.app_version') != base_path('VERSION.txt')) {