Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[cli] Fix: retry download on 500

Neeraj Guptad6c4d5f87f83
diff --git a/cli/internal/api/client.go b/cli/internal/api/client.go
index b2f1645899..1127e6c2c2 100644
--- a/cli/internal/api/client.go
+++ b/cli/internal/api/client.go
@@ -74,7 +74,7 @@ func NewClient(p Params) *Client {
SetRetryWaitTime(5 * time.Second).
SetRetryMaxWaitTime(10 * time.Second).
AddRetryCondition(func(r *resty.Response, err error) bool {
- shouldRetry := r.StatusCode() == 429 || r.StatusCode() > 500
+ shouldRetry := r.StatusCode() == 429 || r.StatusCode() >= 500
if shouldRetry {
log.Printf("retrying download due to %d code", r.StatusCode())
}