github_packages: use exponential backoff when retrying

The retry behaviour in `publish_commit_bottles.yml` [1] is often
successful after the second try, so it's likely that we're not waiting
long enough in between retries here.

Let's fix that by retrying with exponential backoff instead of adding a
fixed interval of five seconds after each failure.

[1] 3241035b2a/.github/workflows/publish-commit-bottles.yml (L431-L443)
This commit is contained in:
Carlo Cabrera 2023-05-03 16:53:28 +08:00
parent 31a152208b
commit 9744b69071
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -440,7 +440,7 @@ class GitHubPackages
rescue ErrorDuringExecution
retry_count += 1
odie "Cannot perform an upload to registry after retrying multiple times!" if retry_count >= 5
sleep 5*retry_count
sleep 5 ** retry_count
retry
end