MCPcopy Index your code
hub / github.com/coder/coder / Close

Method Close

agent/agentscripts/agentscripts.go:455–467  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

453}
454
455func (r *Runner) Close() error {
456 r.closeMutex.Lock()
457 defer r.closeMutex.Unlock()
458 if r.isClosed() {
459 return nil
460 }
461 close(r.closed)
462 // Must cancel the cron ctx BEFORE stopping the cron.
463 r.cronCtxCancel()
464 <-r.cron.Stop().Done()
465 r.cmdCloseWait.Wait()
466 return nil
467}
468
469func (r *Runner) trackCommandGoroutine(fn func()) error {
470 r.closeMutex.Lock()

Callers

nothing calls this directly

Calls 6

isClosedMethod · 0.95
StopMethod · 0.65
WaitMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45
DoneMethod · 0.45

Tested by

no test coverage detected