This commit is contained in:
aaron 2026-02-22 12:02:08 +08:00
parent d885dffb53
commit 923d3d2bbb
3 changed files with 13 additions and 0 deletions

View File

@ -369,6 +369,10 @@ class CryptoAgent:
symbol: 交易对 'BTCUSDT' symbol: 交易对 'BTCUSDT'
""" """
try: try:
# 更新活动时间
monitor = get_system_monitor()
monitor.update_activity("crypto_agent")
logger.info(f"\n{'' * 50}") logger.info(f"\n{'' * 50}")
logger.info(f"📊 {symbol} 分析开始") logger.info(f"📊 {symbol} 分析开始")
logger.info(f"{'' * 50}") logger.info(f"{'' * 50}")

View File

@ -369,6 +369,10 @@ class StockAgent:
Returns: Returns:
分析结果字典包含股票信息和信号 分析结果字典包含股票信息和信号
""" """
# 更新活动时间
monitor = get_system_monitor()
monitor.update_activity("stock_agent")
result = { result = {
'symbol': symbol, 'symbol': symbol,
'current_price': 0, 'current_price': 0,

View File

@ -90,6 +90,11 @@ class SystemStatusMonitor:
if agent_id in self._agents: if agent_id in self._agents:
self._agents[agent_id].config = config self._agents[agent_id].config = config
def update_activity(self, agent_id: str):
"""更新 Agent 活动时间(在执行分析时调用)"""
if agent_id in self._agents:
self._agents[agent_id].last_activity = datetime.now()
def get_agent_status(self, agent_id: str) -> Optional[AgentInfo]: def get_agent_status(self, agent_id: str) -> Optional[AgentInfo]:
"""获取指定 Agent 状态""" """获取指定 Agent 状态"""
return self._agents.get(agent_id) return self._agents.get(agent_id)