2018-10-04 20:10:43 +03:00
|
|
|
<?php
|
2019-05-11 13:32:07 +10:00
|
|
|
/**
|
2020-09-06 19:38:10 +10:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-05-11 13:32:07 +10:00
|
|
|
*
|
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
|
*
|
2021-01-04 08:54:54 +11:00
|
|
|
* @copyright Copyright (c) 2021. 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;
|
|
|
|
|
|
2021-03-25 21:55:59 +11:00
|
|
|
use App\Jobs\Cron\SubscriptionCron;
|
2020-03-08 09:15:11 +11:00
|
|
|
use App\Jobs\Cron\RecurringInvoicesCron;
|
2020-05-05 07:54:24 +10:00
|
|
|
use App\Jobs\Ninja\AdjustEmailQuota;
|
2020-07-05 18:59:28 +10:00
|
|
|
use App\Jobs\Ninja\CompanySizeCheck;
|
2020-04-15 10:30:52 +10:00
|
|
|
use App\Jobs\Util\ReminderJob;
|
2021-01-23 15:52:54 +11:00
|
|
|
use App\Jobs\Util\SchedulerCheck;
|
2020-04-30 21:45:47 +10:00
|
|
|
use App\Jobs\Util\SendFailedEmails;
|
2020-05-12 19:56:30 +10:00
|
|
|
use App\Jobs\Util\UpdateExchangeRates;
|
2020-03-08 09:15:11 +11:00
|
|
|
use App\Jobs\Util\VersionCheck;
|
2020-03-26 00:03:23 +11:00
|
|
|
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.
|
|
|
|
|
*
|
2020-10-28 21:10:49 +11:00
|
|
|
* @param Schedule $schedule
|
2018-10-04 20:10:43 +03:00
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
protected function schedule(Schedule $schedule)
|
|
|
|
|
{
|
2020-09-06 19:38:10 +10:00
|
|
|
|
2021-03-23 23:17:28 +11:00
|
|
|
$schedule->job(new VersionCheck)->daily();
|
2020-03-24 04:15:56 +11:00
|
|
|
|
2020-09-16 20:08:51 +10:00
|
|
|
$schedule->command('ninja:check-data')->daily()->withoutOverlapping();
|
2020-07-21 16:02:15 +10:00
|
|
|
|
2020-09-16 20:08:51 +10:00
|
|
|
$schedule->job(new ReminderJob)->daily()->withoutOverlapping();
|
2020-05-12 19:56:30 +10:00
|
|
|
|
2020-09-16 20:08:51 +10:00
|
|
|
$schedule->job(new CompanySizeCheck)->daily()->withoutOverlapping();
|
2020-07-05 18:59:28 +10:00
|
|
|
|
2020-09-16 20:08:51 +10:00
|
|
|
$schedule->job(new UpdateExchangeRates)->daily()->withoutOverlapping();
|
2020-09-06 19:38:10 +10:00
|
|
|
|
2021-03-25 21:55:59 +11:00
|
|
|
$schedule->job(new SubscriptionCron)->daily()->withoutOverlapping();
|
2021-03-05 21:18:28 +11:00
|
|
|
|
2020-09-16 20:08:51 +10:00
|
|
|
$schedule->job(new RecurringInvoicesCron)->hourly()->withoutOverlapping();
|
2021-03-19 23:37:57 +11:00
|
|
|
|
|
|
|
|
$schedule->job(new SchedulerCheck)->everyFiveMinutes();
|
2020-09-08 20:34:14 +10:00
|
|
|
|
2020-04-30 21:45:47 +10:00
|
|
|
/* Run hosted specific jobs */
|
2020-09-06 19:38:10 +10:00
|
|
|
if (Ninja::isHosted()) {
|
2021-01-23 15:52:54 +11:00
|
|
|
|
2021-03-19 23:37:57 +11:00
|
|
|
$schedule->job(new AdjustEmailQuota)->daily()->withoutOverlapping();
|
|
|
|
|
$schedule->job(new SendFailedEmails)->daily()->withoutOverlapping();
|
2021-01-23 15:52:54 +11:00
|
|
|
|
2020-04-30 21:45:47 +10:00
|
|
|
}
|
2021-03-19 23:37:57 +11:00
|
|
|
|
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');
|
|
|
|
|
}
|
|
|
|
|
}
|