MCPcopy Create free account
hub / github.com/JordanCoin/codemap / shouldRestartDaemon

Function shouldRestartDaemon

cmd/hooks.go:201–215  ·  view source on GitHub ↗
(root string, now time.Time)

Source from the content-addressed store, hash-verified

199}
200
201func shouldRestartDaemon(root string, now time.Time) bool {
202 if !watch.IsRunning(root) {
203 return false
204 }
205 if !isOwnedDaemonProcess(root) {
206 return false
207 }
208
209 state := watch.ReadState(root)
210 if state == nil {
211 return true
212 }
213
214 return now.Sub(state.UpdatedAt) > daemonRestartStaleAfter
215}
216
217func waitForDaemonState(root string, timeout time.Duration) *watch.State {
218 deadline := time.Now().Add(timeout)

Callers 2

TestShouldRestartDaemonFunction · 0.85
hookSessionStartFunction · 0.85

Calls 2

IsRunningFunction · 0.92
ReadStateFunction · 0.92

Tested by 1

TestShouldRestartDaemonFunction · 0.68