mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Add http response code 503 to check.
This commit is contained in:
parent
b5dfcf357a
commit
1d75a16b46
@ -129,7 +129,10 @@ func newWalkFunc(invalidLink *bool, client *http.Client) filepath.WalkFunc {
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
if resp.StatusCode == http.StatusTooManyRequests {
|
||||
// This header is used in 301, 429 and 503.
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
|
||||
// And Go client will follow redirects automatically so the 301 check is probably unnecessary.
|
||||
if resp.StatusCode == http.StatusTooManyRequests || resp.StatusCode == http.StatusServiceUnavailable {
|
||||
retryAfter := resp.Header.Get("Retry-After")
|
||||
if seconds, err := strconv.Atoi(retryAfter); err != nil {
|
||||
backoff = seconds + 10
|
||||
|
Loading…
Reference in New Issue
Block a user