fix: 任务抽屉产出结果优化 + server 启动修复

- 任务抽屉产出结果 tab 优先显示 last_message(日志消息),
  过滤 result_data 中的 None/空值
- 修复 tasks.py 因 opencode 块删除导致的 SyntaxError
- 修复 scheduled_generate 存储 None 值问题
- 清理 DB 中旧 scheduled_refresh_search_cache 的 56 条
  TaskLog + 1 条 TaskConfig
- 更新 PROGRESS.md
This commit is contained in:
Yuzhiran Dev
2026-06-03 11:06:25 +08:00
parent 499c511140
commit c6628b22f6
4 changed files with 12 additions and 18 deletions
+1 -13
View File
@@ -252,19 +252,7 @@ def _get_module_detail_data(module_id: str, db, ROOT, DATA_DIR, LOGS_DIR, today_
outputs = {}
history = []
# try reading queries from yaml
try:
import yaml
cfg_path = ROOT / "config" / "sources.yaml"
if cfg_path.exists():
cfg = yaml.safe_load(cfg_path.read_text(encoding="utf-8"))
ws = cfg.get("sustainability_sources", {}).get("web_search", [])
if ws:
inputs["采集来源"] = f"config/sources.yaml ({len(ws)} 个搜索词)"
except Exception:
pass
elif module_id == "scheduled_fetch_trends":
if module_id == "scheduled_fetch_trends":
trends_file = DATA_DIR / "trends.json"
if trends_file.exists():
try:
+1 -1
View File
@@ -262,7 +262,7 @@ class TaskScheduler:
logger.info("[Scheduled] Review completed for %s", created_id)
_log_task("scheduled_generate", "success", log_id=log_id,
message=f"创作完成" + (f", 选题 {created_id}" if created_id else ""),
result_data={"topic_id": created_id, "review_ok": review_result.get("ok") if review_result else None},
result_data={"topic_id": created_id} if created_id else {"note": "无待生成的选题"},
started_at=started, finished_at=datetime.now(timezone.utc))
except Exception as e:
_log_task("scheduled_generate", "failed", log_id=log_id,