MCPcopy
hub / github.com/google/seesaw / execute

Method execute

healthcheck/core.go:360–375  ·  view source on GitHub ↗

execute invokes the given healthcheck checker with the configured timeout.

()

Source from the content-addressed store, hash-verified

358
359// execute invokes the given healthcheck checker with the configured timeout.
360func (hc *Check) execute() *Result {
361 ch := make(chan *Result, 1)
362 checker := hc.Checker
363 timeout := hc.Timeout
364 go func() {
365 // TODO(jsing): Determine a way to ensure that this go routine
366 // does not linger.
367 ch <- checker.Check(timeout)
368 }()
369 select {
370 case result := <-ch:
371 return result
372 case <-time.After(timeout):
373 return &Result{"Timed out", false, timeout, nil}
374 }
375}
376
377// Stop notifies a running healthcheck that it should quit.
378func (hc *Check) Stop() {

Callers 1

healthcheckMethod · 0.95

Calls 1

CheckMethod · 0.65

Tested by

no test coverage detected