2018-10-04 19:10:43 +02:00
|
|
|
<?php
|
2019-05-11 05:32:07 +02:00
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2020-01-07 01:13:47 +01:00
|
|
|
* @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-03-07 23:15:11 +01:00
|
|
|
use App\Jobs\Cron\RecurringInvoicesCron;
|
2020-05-04 23:54:24 +02:00
|
|
|
use App\Jobs\Ninja\AdjustEmailQuota;
|
2020-04-15 02:30:52 +02:00
|
|
|
use App\Jobs\Util\ReminderJob;
|
2020-04-30 13:45:47 +02:00
|
|
|
use App\Jobs\Util\SendFailedEmails;
|
2020-05-12 11:56:30 +02:00
|
|
|
use App\Jobs\Util\UpdateExchangeRates;
|
2020-03-07 23:15:11 +01:00
|
|
|
use App\Jobs\Util\VersionCheck;
|
2020-03-25 14:03:23 +01:00
|
|
|
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.
|
|
|
|
*
|
2018-10-15 07:00:48 +02:00
|
|
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
2018-10-04 19:10:43 +02:00
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function schedule(Schedule $schedule)
|
|
|
|
{
|
2020-03-25 14:03:23 +01:00
|
|
|
|
2020-03-18 10:40:15 +01:00
|
|
|
//$schedule->job(new RecurringInvoicesCron)->hourly();
|
2020-03-07 23:15:11 +01:00
|
|
|
$schedule->job(new VersionCheck)->daily();
|
2020-03-23 18:15:56 +01:00
|
|
|
|
2020-04-15 02:30:52 +02:00
|
|
|
$schedule->job(new ReminderJob)->daily();
|
2020-05-12 11:56:30 +02:00
|
|
|
|
|
|
|
$schedule->job(new UpdateExchangeRates)->daily();
|
2020-04-15 02:30:52 +02:00
|
|
|
|
2020-04-30 13:45:47 +02:00
|
|
|
/* Run hosted specific jobs */
|
|
|
|
if(Ninja::isHosted()) {
|
2020-05-04 23:51:03 +02:00
|
|
|
$schedule->job(new AdjustEmailQuota())->daily();
|
2020-04-30 13:45:47 +02:00
|
|
|
$schedule->job(new SendFailedEmails())->daily();
|
|
|
|
}
|
2020-03-25 14:03:23 +01:00
|
|
|
/* Run queue's in shared hosting with this*/
|
2020-03-26 04:23:57 +01:00
|
|
|
if (Ninja::isSelfHost()) {
|
2020-03-25 14:03:23 +01:00
|
|
|
$schedule->command('queue:work')->everyMinute()->withoutOverlapping();
|
2020-04-08 12:55:28 +02:00
|
|
|
$schedule->command('queue:restart')->everyFiveMinutes(); //we need to add this as we are seeing cached queues mess up the system on first load.
|
2020-03-26 04:23:57 +01:00
|
|
|
}
|
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');
|
|
|
|
}
|
|
|
|
}
|