From e12aba10e6a1a86abc07a14b1cf210a16b2efa70 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Thu, 21 May 2026 12:27:19 +0800 Subject: [PATCH] auto-sync: 2026-05-21 12:27:19 --- src/daemon/ticker.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/daemon/ticker.py b/src/daemon/ticker.py index 8fae7ae..47585c0 100644 --- a/src/daemon/ticker.py +++ b/src/daemon/ticker.py @@ -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]