Ken 3 天之前
父节点
当前提交
4d0a4b8c2e
共有 1 个文件被更改,包括 7 次插入7 次删除
  1. 7 7
      app/Jobs/FiveSecondTaskJob.php

+ 7 - 7
app/Jobs/FiveSecondTaskJob.php

@@ -16,7 +16,7 @@ class FiveSecondTaskJob implements ShouldQueue
 {
     use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
 
-     /**
+    /**
      * 任务尝试次数
      */
     public $tries = 3;
@@ -54,25 +54,25 @@ class FiveSecondTaskJob implements ShouldQueue
 
             // 你的业务逻辑
             IssueService::getLatestIssue(); // 获取最新的期号
-            
+
             // 重要:使用类名而不是 self(),避免递归
             FiveSecondTaskJob::dispatch()->delay(now()->addSeconds(15));
-            
+
             Log::error('📅 下一个15秒任务已安排');
-            
+
         } catch (\Exception $e) {
             Log::error('❌ 15秒任务执行异常: ' . $e->getMessage());
-            
+
             // 异常后15秒重试
             FiveSecondTaskJob::dispatch()->delay(now()->addSeconds(15));
         }
     }
 
-     // 可选:失败处理
+    // 可选:失败处理
     public function failed(\Throwable $exception)
     {
         Log::error('任务失败: ' . $exception->getMessage());
-        
+
         // 可选:重新分发或通知
         dispatch(new self())->delay(now()->addSeconds(15));
     }