auto-sync: 2026-05-17 21:57:42
This commit is contained in:
+16
-6
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user