chore: try to add stop task more info #75

This commit is contained in:
duorameng
2026-04-30 16:08:22 +08:00
parent cfdf186b93
commit 40e37b797c
6 changed files with 91 additions and 22 deletions
+8
View File
@@ -194,6 +194,14 @@ func (m *AgentWSManager) GetConnection(agentID string) *AgentConnection {
return m.connections[agentID]
}
// IsAgentOnline 检查指定 Agent 是否在线
func (m *AgentWSManager) IsAgentOnline(agentID string) bool {
m.mu.RLock()
defer m.mu.RUnlock()
_, exists := m.connections[agentID]
return exists
}
// SendToAgent 发送消息给指定 Agent
func (m *AgentWSManager) SendToAgent(agentID string, msgType string, data interface{}) error {
conn := m.GetConnection(agentID)