auto-sync: 2026-05-21 12:27:19
This commit is contained in:
+4
-13
@@ -488,9 +488,9 @@ class Ticker:
|
||||
return []
|
||||
|
||||
# 全局并发检查(司马懿建议 1)
|
||||
if self.counter.global_active >= self.counter._max_global - 1:
|
||||
if self.counter.is_near_limit():
|
||||
logger.info("Skipping broadcast: global concurrent near limit (%d/%d)",
|
||||
self.counter.global_active, self.counter._max_global)
|
||||
self.counter.global_active, self.counter.max_global)
|
||||
return []
|
||||
|
||||
# 过滤掉已广播太多次的任务(retry_count >= 3 → 不广播,等庞统)
|
||||
@@ -524,17 +524,8 @@ class Ticker:
|
||||
# 获取空闲 Agent
|
||||
idle_agents = self._get_idle_agents()
|
||||
if not idle_agents:
|
||||
# 无空闲 Agent → 递增 retry_count(下次广播或升级)
|
||||
conn = get_connection(db_path)
|
||||
try:
|
||||
for t in broadcastable:
|
||||
conn.execute(
|
||||
"UPDATE tasks SET retry_count = COALESCE(retry_count, 0) + 1 WHERE id=?",
|
||||
(t.id,),
|
||||
)
|
||||
conn.commit()
|
||||
finally:
|
||||
conn.close()
|
||||
# 无空闲 Agent → 系统容量问题,不递增 retry_count
|
||||
logger.warning("No idle agents for broadcast, skipping (capacity issue)")
|
||||
return []
|
||||
|
||||
task_ids = [t.id for t in broadcastable]
|
||||
|
||||
Reference in New Issue
Block a user