MCPcopy Create free account
hub / github.com/compozy/agh / nextBackoff

Function nextBackoff

internal/registry/github/client.go:940–953  ·  view source on GitHub ↗
(current time.Duration, maxDelay time.Duration)

Source from the content-addressed store, hash-verified

938}
939
940func nextBackoff(current time.Duration, maxDelay time.Duration) time.Duration {
941 if current <= 0 {
942 return defaultInitialBackoff
943 }
944 if maxDelay <= 0 {
945 maxDelay = defaultMaxBackoff
946 }
947
948 next := current * 2
949 if next > maxDelay {
950 return maxDelay
951 }
952 return next
953}
954
955func spoolDownloadResponse(body io.Reader, slug string, maxBytes int64) (_ io.ReadCloser, size int64, err error) {
956 file, err := os.CreateTemp("", "agh-github-download-*")

Callers 2

waitForRetryMethod · 0.70

Calls

no outgoing calls

Tested by 1