Skip to content

Commit

Permalink
Retry gem downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
jkeiser committed Aug 11, 2016
1 parent 4a4b837 commit c6b3e42
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/bundler/rubygems_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,16 @@ def build_gem(gem_dir, spec)
build(spec)
end

RUBYGEMS_DOWNLOAD_ERRORS = [
Gem::RemoteFetcher::FetchError,
].freeze

def download_gem(spec, uri, path)
uri = Bundler.settings.mirror_for(uri)
fetcher = Gem::RemoteFetcher.new(configuration[:http_proxy])
fetcher.download(spec, uri, path)
Bundler::Retry.new("download gem #{uri}", RUBYGEMS_DOWNLOAD_ERRORS).attempts do
fetcher.download(spec, uri, path)
end
end

def security_policy_keys
Expand Down

0 comments on commit c6b3e42

Please sign in to comment.