delay(now()->addSeconds(5)); Log::info('📅 下一个5秒任务已安排'); } catch (\Exception $e) { Log::error('❌ 5秒任务执行异常: ' . $e->getMessage()); // 异常后10秒重试 FiveSecondTaskJob::dispatch()->delay(now()->addSeconds(10)); } } // 可选:失败处理 public function failed(\Throwable $exception) { Log::error('任务失败: ' . $exception->getMessage()); // 可选:重新分发或通知 dispatch(new self())->delay(now()->addSeconds(5)); } }