Refactor schedule checker

This commit is contained in:
David Bomba 2021-10-08 21:06:24 +11:00
parent de4aaabcc9
commit a303e9bf95
2 changed files with 5 additions and 2 deletions

View File

@ -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()) {

View File

@ -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'))
{