MCPcopy
hub / github.com/google/cadvisor / RetryForDuration

Function RetryForDuration

integration/framework/framework.go:467–477  ·  view source on GitHub ↗

Runs retryFunc until no error is returned. After dur time the last error is returned. Note that the function does not timeout the execution of retryFunc when the limit is reached.

(retryFunc func() error, dur time.Duration)

Source from the content-addressed store, hash-verified

465// Runs retryFunc until no error is returned. After dur time the last error is returned.
466// Note that the function does not timeout the execution of retryFunc when the limit is reached.
467func RetryForDuration(retryFunc func() error, dur time.Duration) error {
468 waitUntil := time.Now().Add(dur)
469 var err error
470 for time.Now().Before(waitUntil) {
471 err = retryFunc()
472 if err == nil {
473 return nil
474 }
475 }
476 return err
477}
478
479// CRI-O pod sandbox configuration for crictl
480type crioPodConfig struct {

Callers 8

waitForCrioContainerFunction · 0.92
waitForContainerInfoFunction · 0.92
waitForContainerFunction · 0.92

Calls 1

AddMethod · 0.65

Tested by 8

waitForCrioContainerFunction · 0.74
waitForContainerInfoFunction · 0.74
waitForContainerFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…