auto-sync: 2026-05-19 23:33:08

This commit is contained in:
cfdaily
2026-05-19 23:33:08 +08:00
parent 78b9956819
commit 85d83c1aa7
+25 -1
View File
@@ -258,7 +258,31 @@ class Ticker:
finally:
conn.close()
# 8. 扫描后状态
# 8. 健康检查(僵尸检测)
if self.health_checker:
try:
self.health_checker.check(project_id, db_path, self._tick_count)
except Exception as e:
logger.warning("HealthChecker error for %s: %s", project_id, e)
# 9. 经验蒸馏(完成的 task 自动触发)
if self.experience_distiller:
try:
conn2 = get_connection(db_path)
try:
done_tasks = conn2.execute(
"SELECT id FROM tasks WHERE status='done' AND updated_at > datetime('now', '-60 seconds')"
).fetchall()
finally:
conn2.close()
for row in done_tasks:
task = Blackboard(db_path).get_task(row[0])
if task:
self.experience_distiller.distill_from_task(task)
except Exception as e:
logger.warning("ExperienceDistiller error for %s: %s", project_id, e)
# 10. 扫描后状态
result["summary_after"] = queries.task_summary()
return result