MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / Stop

Method Stop

internal/loop/manager.go:362–388  ·  view source on GitHub ↗

Stop stops the loop for a specific PRD immediately.

(name string)

Source from the content-addressed store, hash-verified

360
361// Stop stops the loop for a specific PRD immediately.
362func (m *Manager) Stop(name string) error {
363 m.mu.RLock()
364 instance, exists := m.instances[name]
365 m.mu.RUnlock()
366
367 if !exists {
368 return fmt.Errorf("PRD %s not found", name)
369 }
370
371 instance.mu.Lock()
372 defer instance.mu.Unlock()
373
374 if instance.State != LoopStateRunning && instance.State != LoopStatePaused {
375 return nil // Already stopped
376 }
377
378 if instance.Loop != nil {
379 instance.Loop.Stop()
380 }
381 if instance.cancel != nil {
382 instance.cancel()
383 }
384
385 instance.State = LoopStateStopped
386
387 return nil
388}
389
390// UpdateWorktreeInfo updates the worktree directory and branch for an existing PRD instance.
391func (m *Manager) UpdateWorktreeInfo(name, worktreeDir, branch string) error {

Callers 3

UnregisterMethod · 0.95
StopAllMethod · 0.95

Calls

no outgoing calls

Tested by 1