MCPcopy Index your code
hub / github.com/docker/docker-agent / Set

Method Set

pkg/tools/lifecycle/state.go:95–104  ·  view source on GitHub ↗

Set transitions to s, recording the transition time and clearing the last error. Same-state Set is a no-op (preserves Since/LastError).

(s State)

Source from the content-addressed store, hash-verified

93// Set transitions to s, recording the transition time and clearing the
94// last error. Same-state Set is a no-op (preserves Since/LastError).
95func (t *Tracker) Set(s State) {
96 t.mu.Lock()
97 defer t.mu.Unlock()
98 if t.state == s {
99 return
100 }
101 t.state = s
102 t.since = time.Now()
103 t.lastErr = nil
104}
105
106// Fail transitions to s and records err as the last error. Use this when
107// entering Failed/Restarting after a failure so the supervisor's snapshot

Callers 15

TestTracker_ConcurrentFunction · 0.95
MarkReadyForTestingMethod · 0.45
StartMethod · 0.45
StopMethod · 0.45
tryRestartMethod · 0.45
runJavascriptMethod · 0.45
TestFetch_Call_SuccessFunction · 0.45
TestFetch_MarkdownFunction · 0.45
TestFetch_TextFunction · 0.45

Calls 3

NowMethod · 0.80
LockMethod · 0.45
UnlockMethod · 0.45