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

84 lines
2.5 KiB
PHP
Raw Normal View History

2018-10-04 19:10:43 +02:00
<?php
2019-05-11 05:32:07 +02:00
/**
* Invoice Ninja (https://invoiceninja.com).
2019-05-11 05:32:07 +02:00
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
2019-05-11 05:32:07 +02:00
*
* @license https://opensource.org/licenses/AAL
*/
2018-10-04 19:10:43 +02:00
namespace App\Console;
2020-07-21 08:02:15 +02:00
use App\Console\Commands\CheckData;
use App\Jobs\Cron\RecurringInvoicesCron;
use App\Jobs\Ninja\AdjustEmailQuota;
2020-06-10 07:21:11 +02:00
use App\Jobs\Ninja\CheckDbStatus;
2020-07-05 10:59:28 +02:00
use App\Jobs\Ninja\CompanySizeCheck;
use App\Jobs\Util\ReminderJob;
use App\Jobs\Util\SendFailedEmails;
use App\Jobs\Util\UpdateExchangeRates;
use App\Jobs\Util\VersionCheck;
use App\Utils\Ninja;
2018-10-04 19:10:43 +02: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 19:10:43 +02:00
* @return void
*/
protected function schedule(Schedule $schedule)
{
//$schedule->job(new RecurringInvoicesCron)->hourly();
2020-09-16 12:08:51 +02:00
$schedule->job(new VersionCheck)->daily()->withoutOverlapping();
2020-09-16 12:08:51 +02:00
$schedule->command('ninja:check-data')->daily()->withoutOverlapping();
2020-07-21 08:02:15 +02:00
2020-09-16 12:08:51 +02:00
$schedule->job(new ReminderJob)->daily()->withoutOverlapping();
2020-09-16 12:08:51 +02:00
$schedule->job(new CompanySizeCheck)->daily()->withoutOverlapping();
2020-07-05 10:59:28 +02:00
2020-09-16 12:08:51 +02:00
$schedule->job(new UpdateExchangeRates)->daily()->withoutOverlapping();
2020-09-16 12:08:51 +02:00
$schedule->job(new RecurringInvoicesCron)->hourly()->withoutOverlapping();
2020-09-08 12:34:14 +02:00
/* Run hosted specific jobs */
if (Ninja::isHosted()) {
2020-09-16 12:08:51 +02:00
$schedule->job(new AdjustEmailQuota())->daily()->withoutOverlapping();
$schedule->job(new SendFailedEmails())->daily()->withoutOverlapping();
}
/* Run queue's in shared hosting with this*/
if (Ninja::isSelfHost()) {
$schedule->command('queue:work')->everyMinute()->withoutOverlapping();
2020-09-16 12:08:51 +02:00
$schedule->command('queue:restart')->everyFiveMinutes()->withoutOverlapping(); //we need to add this as we are seeing cached queues mess up the system on first load.
}
2018-10-04 19:10:43 +02:00
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}