auto-sync: 2026-05-26 08:26:12

This commit is contained in:
cfdaily
2026-05-26 08:26:12 +08:00
parent 5ec07664b2
commit feff713e0a
+10
View File
@@ -671,6 +671,16 @@ class Ticker:
"""从 Dispatcher 获取 counter"""
return getattr(self.dispatcher, 'counter', None) if self.dispatcher else None
@staticmethod
def _is_pid_alive(pid: int) -> bool:
"""检查进程是否存活"""
import os
try:
os.kill(pid, 0)
return True
except (ProcessLookupError, PermissionError):
return False
def _get_idle_agents(self) -> List[str]:
"""获取当前空闲的 Agent 列表(从 config agents 取,而非 counter._per_agent"""
if not self.counter: