GCS driver: fix retry function
Signed-off-by: Arthur Baars <arthur@semmle.com>
This commit is contained in:
parent
5529baa918
commit
bf1e41a9f2
2 changed files with 43 additions and 3 deletions
|
@ -318,13 +318,13 @@ func retry(maxTries int, req request) error {
|
|||
backoff := time.Second
|
||||
var err error
|
||||
for i := 0; i < maxTries; i++ {
|
||||
err := req()
|
||||
err = req()
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
status := err.(*googleapi.Error)
|
||||
if status == nil || (status.Code != 429 && status.Code < http.StatusInternalServerError) {
|
||||
status, ok := err.(*googleapi.Error)
|
||||
if !ok || (status.Code != 429 && status.Code < http.StatusInternalServerError) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue