1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

INA-5 | TaskScheduler Job [WIP]

This commit is contained in:
Nikola Cirkovic 2022-05-19 00:33:38 +02:00
parent 131cacd47f
commit 753978fe86

View File

@ -19,6 +19,7 @@ use App\Jobs\Ledger\LedgerBalanceUpdate;
use App\Jobs\Ninja\AdjustEmailQuota;
use App\Jobs\Ninja\CompanySizeCheck;
use App\Jobs\Ninja\QueueSize;
use App\Jobs\Ninja\TaskScheduler;
use App\Jobs\Util\DiskCleanup;
use App\Jobs\Util\ReminderJob;
use App\Jobs\Util\SchedulerCheck;
@ -69,17 +70,18 @@ class Kernel extends ConsoleKernel
$schedule->job(new RecurringExpensesCron)->dailyAt('00:10')->withoutOverlapping();
$schedule->job(new AutoBillCron)->dailyAt('06:00')->withoutOverlapping();
$schedule->job(new AutoBillCron)->dailyAt('06:00')->withoutOverlapping();
$schedule->job(new SchedulerCheck)->daily()->withoutOverlapping();
if(Ninja::isSelfHost())
{
$schedule->job(new TaskScheduler())->daily()->withoutOverlapping();
if (Ninja::isSelfHost()) {
$schedule->call(function () {
Account::whereNotNull('id')->update(['is_scheduler_running' => true]);
})->everyFiveMinutes();
})->everyFiveMinutes();
}
/* Run hosted specific jobs */
@ -97,12 +99,12 @@ class Kernel extends ConsoleKernel
}
if(config('queue.default') == 'database' && Ninja::isSelfHost() && config('ninja.internal_queue_enabled') && !config('ninja.is_docker')) {
if (config('queue.default') == 'database' && Ninja::isSelfHost() && config('ninja.internal_queue_enabled') && !config('ninja.is_docker')) {
$schedule->command('queue:work database --stop-when-empty')->everyMinute()->withoutOverlapping();
$schedule->command('queue:restart')->everyFiveMinutes()->withoutOverlapping();
$schedule->command('queue:restart')->everyFiveMinutes()->withoutOverlapping();
}
}
@ -114,7 +116,7 @@ class Kernel extends ConsoleKernel
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
$this->load(__DIR__ . '/Commands');
require base_path('routes/console.php');
}