auto-sync: 2026-05-17 21:57:42

This commit is contained in:
cfdaily
2026-05-17 21:57:42 +08:00
parent 4adc857364
commit 06895d3ffd
+16 -6
View File
@@ -496,12 +496,22 @@ class Ticker:
try:
conn = get_connection(db_path)
try:
row = conn.execute(
"SELECT COUNT(*) as cnt FROM routing_decisions "
"WHERE task_id=? AND outcome='dispatched' "
"AND created_at > datetime('now', '-5 minutes')",
(task_id,),
).fetchone()
# 检查是否有 from_status=review 的 dispatched 记录(防止重复 review dispatch
if action_type == "review":
row = conn.execute(
"SELECT COUNT(*) as cnt FROM routing_decisions "
"WHERE task_id=? AND outcome='dispatched' "
"AND from_status='review' "
"AND created_at > datetime('now', '-5 minutes')",
(task_id,),
).fetchone()
else:
row = conn.execute(
"SELECT COUNT(*) as cnt FROM routing_decisions "
"WHERE task_id=? AND outcome='dispatched' "
"AND created_at > datetime('now', '-5 minutes')",
(task_id,),
).fetchone()
return row["cnt"] > 0 if row else False
finally:
conn.close()