MCPcopy
hub / github.com/cloudflare/cloudflared / NewBackoff

Function NewBackoff

retry/backoffhandler.go:40–47  ·  view source on GitHub ↗
(maxRetries uint, baseTime time.Duration, retryForever bool)

Source from the content-addressed store, hash-verified

38}
39
40func NewBackoff(maxRetries uint, baseTime time.Duration, retryForever bool) BackoffHandler {
41 return BackoffHandler{
42 maxRetries: maxRetries,
43 baseTime: baseTime,
44 retryForever: retryForever,
45 Clock: Clock{Now: time.Now, After: time.After},
46 }
47}
48
49func (b BackoffHandler) GetMaxBackoffDuration(ctx context.Context) (time.Duration, bool) {
50 // Follows the same logic as Backoff, but without mutating the receiver.

Callers 3

RunMethod · 0.92
initializeMethod · 0.92

Calls

no outgoing calls

Tested by 1