invoiceninja/app/Console/Kernel.php

62 lines
1.6 KiB
PHP
Raw Normal View History

2018-10-04 20:10:43 +03:00
<?php
2019-05-11 13:32:07 +10:00
/**
* Invoice Ninja (https://invoiceninja.com)
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
2019-05-11 13:32:07 +10:00
*
* @license https://opensource.org/licenses/AAL
*/
2018-10-04 20:10:43 +03:00
namespace App\Console;
use App\Jobs\Cron\RecurringInvoicesCron;
use App\Jobs\Util\VersionCheck;
use App\Utils\Ninja;
2018-10-04 20:10:43 +03:00
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
2018-10-04 20:10:43 +03:00
* @return void
*/
protected function schedule(Schedule $schedule)
{
//$schedule->job(new RecurringInvoicesCron)->hourly();
$schedule->job(new VersionCheck)->daily();
/* Run queue's in shared hosting with this*/
if (Ninja::isSelfHost()) {
$schedule->command('queue:work')->everyMinute()->withoutOverlapping();
$schedule->command('queue:restart')->everyFiveMinutes(); //we need to add this as we are seeing cached queues mess up the system on first load.
}
2018-10-04 20:10:43 +03:00
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}