|
|
@@ -44,9 +44,9 @@ class FiveSecondTaskJob implements ShouldQueue
|
|
|
public function handle()
|
|
|
{
|
|
|
try {
|
|
|
- Log::error('🚀 开始执行5秒任务: ' . now());
|
|
|
-
|
|
|
+ Log::error('🚀 开始执行10秒任务: ' . now());
|
|
|
|
|
|
+ IssueService::syncCountdownIssue(); // 提前20秒提醒
|
|
|
|
|
|
IssueService::syncCloseIssue(); // 同步停止
|
|
|
// Log::error('✅ 获取到最新期号: ' . ($latestIssue ?? '无'));
|
|
|
@@ -55,12 +55,12 @@ class FiveSecondTaskJob implements ShouldQueue
|
|
|
IssueService::getLatestIssue(); // 获取最新的期号
|
|
|
|
|
|
// 重要:使用类名而不是 self(),避免递归
|
|
|
- FiveSecondTaskJob::dispatch()->delay(now()->addSeconds(5));
|
|
|
+ FiveSecondTaskJob::dispatch()->delay(now()->addSeconds(10));
|
|
|
|
|
|
- Log::error('📅 下一个5秒任务已安排');
|
|
|
+ Log::error('📅 下一个10秒任务已安排');
|
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
- Log::error('❌ 5秒任务执行异常: ' . $e->getMessage());
|
|
|
+ Log::error('❌ 10秒任务执行异常: ' . $e->getMessage());
|
|
|
|
|
|
// 异常后10秒重试
|
|
|
FiveSecondTaskJob::dispatch()->delay(now()->addSeconds(10));
|
|
|
@@ -73,6 +73,6 @@ class FiveSecondTaskJob implements ShouldQueue
|
|
|
Log::error('任务失败: ' . $exception->getMessage());
|
|
|
|
|
|
// 可选:重新分发或通知
|
|
|
- dispatch(new self())->delay(now()->addSeconds(5));
|
|
|
+ dispatch(new self())->delay(now()->addSeconds(10));
|
|
|
}
|
|
|
}
|