|
|
@@ -4,6 +4,7 @@
|
|
|
use Illuminate\Support\Facades\Artisan;
|
|
|
|
|
|
use Illuminate\Support\Facades\Schedule;
|
|
|
+use App\Services\SyncFootballDataService;
|
|
|
|
|
|
use App\Jobs\DailyReportJob;
|
|
|
|
|
|
@@ -40,4 +41,10 @@
|
|
|
->onOneServer() // 多服务器部署时防止重复执行(推荐)
|
|
|
->withoutOverlapping() // 防止重叠执行(如果上一次还没完,这次不跑)
|
|
|
->name('report-every-12h')
|
|
|
- ->description('每 12 小时生成一次报表');
|
|
|
+ ->description('每 12 小时生成一次报表');
|
|
|
+
|
|
|
+ // 或者调用闭包
|
|
|
+Schedule::call(function () {
|
|
|
+ // 每日同步国家数据
|
|
|
+ SyncFootballDataService::syncCountry();
|
|
|
+})->daily()->name('每日清理任务')->withoutOverlapping();
|