Skip to content

Commit

Permalink
Retrying download only on 503 status code
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpert committed Jul 23, 2023
1 parent 0a76412 commit 9bb8109
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions snapshot/nats_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ func (n *natsStorage) Download(filePath, name string) error {
log.Warn().
Err(err).
Int("Status", jsmErr.APIError().Code).
Msg("Error downloading snapshot, retrying...")
time.Sleep(time.Second)
continue
Msg("Error downloading snapshot")

if jsmErr.APIError().Code == 503 {
time.Sleep(time.Second)
continue
}
}

return err
Expand Down

0 comments on commit 9bb8109

Please sign in to comment.