MCPcopy Create free account
hub / github.com/astercloud/aster / handleStop

Method handleStop

pkg/agent/actor.go:444–455  ·  view source on GitHub ↗

handleStop 处理停止

()

Source from the content-addressed store, hash-verified

442
443// handleStop 处理停止
444func (a *AgentActor) handleStop() {
445 a.mu.Lock()
446 a.isRunning = false
447 a.mu.Unlock()
448
449 // 取消所有运行中的 goroutine
450 a.cancel()
451
452 if err := a.agent.Close(); err != nil {
453 agentLog.Error(context.Background(), "agent actor close error", map[string]any{"agent_id": a.agent.ID(), "error": err})
454 }
455}
456
457// recordError 记录错误
458func (a *AgentActor) recordError(err error) {

Callers 1

ReceiveMethod · 0.95

Calls 4

CloseMethod · 0.65
ErrorMethod · 0.65
IDMethod · 0.65
cancelMethod · 0.45

Tested by

no test coverage detected