(current time.Duration, maxDelay time.Duration)
| 938 | } |
| 939 | |
| 940 | func 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 | |
| 955 | func spoolDownloadResponse(body io.Reader, slug string, maxBytes int64) (_ io.ReadCloser, size int64, err error) { |
| 956 | file, err := os.CreateTemp("", "agh-github-download-*") |
no outgoing calls