MCPcopy
hub / github.com/docker/docker-agent / Stop

Method Stop

pkg/tools/startable.go:212–224  ·  view source on GitHub ↗

Stop stops the toolset if it implements Startable and resets the started flag so that a subsequent Start will re-initialize.

(ctx context.Context)

Source from the content-addressed store, hash-verified

210// Stop stops the toolset if it implements Startable and resets
211// the started flag so that a subsequent Start will re-initialize.
212func (s *StartableToolSet) Stop(ctx context.Context) error {
213 s.mu.Lock()
214 defer s.mu.Unlock()
215
216 s.started = false
217 s.startStreak.reset()
218 s.listStreak.reset()
219 s.recoveryStreak.reset()
220 if startable, ok := As[Startable](s.ToolSet); ok {
221 return startable.Stop(ctx)
222 }
223 return nil
224}
225
226// ShouldReportFailure returns true exactly once per failure streak — after
227// the first failed Start() and before the streak ends (a successful

Callers

nothing calls this directly

Calls 4

StopMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected