CaiWuXiTong/app/Console/Kernel.php

76 lines
2.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace App\Console;
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)
{
// Not installed yet
if (!config('app.installed')) {
return;
}
$schedule_time = config('app.schedule_time');
$schedule->command('reminder:invoice')->dailyAt($schedule_time);
$schedule->command('reminder:bill')->dailyAt($schedule_time);
$schedule->command('recurring:check')->dailyAt($schedule_time)->runInBackground();
$schedule->command('storage-temp:clear')->dailyAt('17:00');
$schedule->command('model:prune')->dailyAt('17:00');
if ((bool) config('services.esign.polling_enabled', false)) {
$schedule->command('esign:poll-signatures --quiet')
->cron('*/2 * * * *')
->withoutOverlapping(5)
->runInBackground();
}
// 账单冲减页面(500112 冲减收入)每 30 分钟续传到共享业务镜像。
// 走专用命令避开 business_data.datasets 的 clickhouse 放置策略;
// refresh_enabled 仅在生产刷新节点开启,本地 schedule 不会真的拉上游。
$schedule->command('business-mirror:sync-bill-offset --max-batches=2')
->everyThirtyMinutes()
->withoutOverlapping(15)
->runInBackground();
}
/**
* Register the Closure based commands for the application.
*
* @return void
*/
protected function commands()
{
require base_path('routes/console.php');
$this->load(__DIR__ . '/Commands');
}
/**
* Get the timezone that should be used by default for scheduled events.
*
* @return \DateTimeZone|string|null
*/
protected function scheduleTimezone()
{
return config('app.timezone');
}
}