2021-04-02 19:48:41 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Console;
|
|
|
|
|
|
2022-05-06 15:50:26 +08:00
|
|
|
use Carbon\Carbon;
|
2021-04-02 19:48:41 +08: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
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
protected function schedule(Schedule $schedule)
|
|
|
|
|
{
|
2022-05-06 15:50:26 +08:00
|
|
|
$schedule->command('exam:assign_cronjob')->everyMinute()->withoutOverlapping();
|
|
|
|
|
$schedule->command('exam:checkout_cronjob')->everyMinute()->withoutOverlapping();
|
|
|
|
|
$schedule->command('exam:update_progress --bulk=1')->hourly()->withoutOverlapping();
|
|
|
|
|
$schedule->command('backup:cronjob')->everyMinute()->withoutOverlapping();
|
|
|
|
|
$schedule->command('hr:update_status')->everyMinute()->withoutOverlapping();
|
|
|
|
|
$schedule->command('hr:update_status --ignore_time=1')->hourly()->withoutOverlapping();
|
2022-02-28 23:20:42 +08:00
|
|
|
$schedule->command('user:delete_expired_token')->dailyAt('04:00');
|
2022-05-06 15:50:26 +08:00
|
|
|
$schedule->command('claim:settle')->hourly()->between("00:00", "12:00")
|
|
|
|
|
->when(function () {Carbon::now()->format('d') == '01';})->withoutOverlapping();
|
2021-04-02 19:48:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Register the commands for the application.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
protected function commands()
|
|
|
|
|
{
|
|
|
|
|
$this->load(__DIR__.'/Commands');
|
|
|
|
|
|
|
|
|
|
require base_path('routes/console.php');
|
|
|
|
|
}
|
|
|
|
|
}
|