Skip to content

Commit 76bc506

Browse files
committed
don't retry access errors
1 parent ed8d470 commit 76bc506

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/utils/requests.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@ function github_retry_decision(method::String, resp::Union{HTTP.Response, Nothin
127127
is_primary_rate_limit = occursin("primary rate limit", lowercase(body)) && status in (403, 429)
128128
is_secondary_rate_limit = occursin("secondary rate limit", lowercase(body)) && status in (403, 429)
129129

130-
do_retry = HTTP.RetryRequest.isidempotent(method) && (is_primary_rate_limit || is_secondary_rate_limit || HTTP.RetryRequest.retryable(status))
130+
# `other_retry` is `HTTP.RetryRequest.retryable(status)` minus 403,
131+
# since if it's not a rate-limit, we don't want to retry 403s.
132+
other_retry = status in (408, 409, 429, 500, 502, 503, 504, 599)
133+
134+
do_retry = HTTP.RetryRequest.isidempotent(method) && (is_primary_rate_limit || is_secondary_rate_limit || other_retry)
131135

132136
if !do_retry
133137
return (false, 0.0)

0 commit comments

Comments
 (0)