MCPcopy Create free account
hub / github.com/coder/coder / effectiveDelay

Function effectiveDelay

coderd/x/chatd/chatretry/chatretry.go:55–61  ·  view source on GitHub ↗

effectiveDelay returns the delay for the given 0-indexed attempt while honoring any provider-supplied minimum retry delay.

(attempt int, classified ClassifiedError)

Source from the content-addressed store, hash-verified

53// effectiveDelay returns the delay for the given 0-indexed attempt
54// while honoring any provider-supplied minimum retry delay.
55func effectiveDelay(attempt int, classified ClassifiedError) time.Duration {
56 delay := Delay(attempt)
57 if classified.RetryAfter > delay {
58 return classified.RetryAfter
59 }
60 return delay
61}
62
63// RetryFn is the function to retry. It receives a context and returns
64// an error. The context may be a child of the original with adjusted

Callers 1

RetryFunction · 0.85

Calls 1

DelayFunction · 0.85

Tested by

no test coverage detected