Skip to content

Commit

Permalink
Changed exponential backoff to larger timeouts (#31)
Browse files Browse the repository at this point in the history
Exponential backoff now follows formula 5**i instead of 0.5*2**i.
I.e. the first four factors are 1, 5, 25 and 125 seconds now.
  • Loading branch information
mephenor authored Jul 29, 2022
1 parent 0db5a97 commit 0483519
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ghga_connector/core/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ def retry():
raise error
error_causes.append(error)
# Use exponential backoff for retries
backoff_factor = 0.5
exponential_backoff = backoff_factor * (2 ** (i))
exponential_backoff = 5**i
time.sleep(exponential_backoff)
raise exceptions.MaxRetriesReachedError(
func_name=self._func.__name__, causes=error_causes
Expand Down

0 comments on commit 0483519

Please sign in to comment.