github_packages: adjust upload retries

We still regularly see upload failures here, so let's adjust this to see
if we can try to reduce these.
This commit is contained in:
Carlo Cabrera 2023-05-30 11:55:08 +08:00
parent 33a3f72fbc
commit 65be47848d
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -429,7 +429,7 @@ class GitHubPackages
"org.opencontainers.image.ref.name" => version_rebuild) "org.opencontainers.image.ref.name" => version_rebuild)
puts puts
args = ["copy", "--retry-times=2", "--all", "oci:#{root}", image_uri.to_s] args = ["copy", "--retry-times=3", "--all", "oci:#{root}", image_uri.to_s]
if dry_run if dry_run
puts "#{skopeo} #{args.join(" ")} --dest-creds=#{user}:$HOMEBREW_GITHUB_PACKAGES_TOKEN" puts "#{skopeo} #{args.join(" ")} --dest-creds=#{user}:$HOMEBREW_GITHUB_PACKAGES_TOKEN"
else else
@ -439,8 +439,8 @@ class GitHubPackages
system_command!(skopeo, verbose: true, print_stdout: true, args: args) system_command!(skopeo, verbose: true, print_stdout: true, args: args)
rescue ErrorDuringExecution rescue ErrorDuringExecution
retry_count += 1 retry_count += 1
odie "Cannot perform an upload to registry after retrying multiple times!" if retry_count >= 5 odie "Cannot perform an upload to registry after retrying multiple times!" if retry_count >= 10
sleep 5 ** retry_count sleep 2 ** retry_count
retry retry
end end