mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Refactor schedule checker
This commit is contained in:
parent
de4aaabcc9
commit
a303e9bf95
@ -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()) {
|
||||
|
||||
|
@ -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'))
|
||||
{
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user