dy-dashboard/vault/知识库/工作指南/训练记录/2026-08-18-排查修复定时任务失败.md
2026-10-28 11:14:17 +08:00

16 lines
1.3 KiB
Markdown
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.

# 2026-08-18 排查修复定时任务失败
### 1. 检查定时任务运行状态
**旭东 → OpenClaw:**
> 检查一下每日的定时任务是否能够正常运行,我发现最近几天的定时任务全部失败了
**OpenClaw 响应:**
排查发现 6 个定时任务中 4 个持续失败(dy-data-auto-update 连续失败 97 次、每日知识笔记 54 次、dy-data-clean 43 次、dy-dashboard daily backup 10 次),仅「知识库每日检查」(凌晨 3 点)正常。
**根因**:4 个失败任务均为 agentTurn 类型(需 LLM 参与)。OpenClaw 对带显式超时的 cron 云端模型运行设有 60 秒流式停顿上限(模型空闲超时);deepseek API 在任务时段(7:00/8:00/12:00/18:00/22:00)响应慢,停顿超过 60 秒即触发超时,而任务未配置 fallback 模型,直接失败。凌晨 3 点时段 API 负载低,故「知识库每日检查」正常。
**修复**:为 4 个失败任务配置 fallback 模型 `openlux/gpt-5.6-sol`,并将任务超时从 300s 提升至 600s。模型停顿超时后自动切换备用模型继续执行。
**验证**:手动触发 dy-data-auto-update(113s 成功,脚本实际执行 18s 完成数据更新)与 dy-dashboard daily backup(107s 成功,已投递钉钉),均恢复正常。