Merge pull request #15495 from carlocab/github-packages-retry

github_packages: adjust upload retries
This commit is contained in:
Carlo Cabrera 2023-05-30 15:38:10 +08:00 committed by GitHub
commit 02d0e7f4b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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