MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / Shutdown

Method Shutdown

agent/task_runtime.go:216–237  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

214}
215
216func (rt *AgentTaskRuntime) Shutdown() {
217 rt.mu.Lock()
218 type taskRef struct {
219 id string
220 scope string
221 }
222 refs := make([]taskRef, 0, len(rt.records))
223 for id, record := range rt.records {
224 if _, terminal := terminalTaskStatuses[record.Status]; terminal {
225 continue
226 }
227 refs = append(refs, taskRef{id: id, scope: record.ParentScopeID})
228 }
229 rt.mu.Unlock()
230 for _, ref := range refs {
231 rt.StopTask(ref.id, ref.scope)
232 }
233 rt.mu.Lock()
234 rt.cancelAllRecordCleanupLocked()
235 rt.cancelAllIdleTTLLocked()
236 rt.mu.Unlock()
237}
238
239func (rt *AgentTaskRuntime) ListTasks(scopeID string) []AgentTaskRecord {
240 rt.mu.Lock()

Callers 1

Calls 3

StopTaskMethod · 0.95

Tested by 1