Skip to content

Commit

Permalink
Allow configuring Hydra max concurrency to reduce flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
maikelvdh committed Aug 6, 2024
1 parent 7593a4c commit beec95a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/cocoapods-core/cdn_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module Pod
class CDNSource < Source
include Concurrent

MAX_CONCURRENCY = (ENV['COCOAPODS_CDN_MAX_CONCURRENCY'] || 200).to_i
MAX_NUMBER_OF_RETRIES = (ENV['COCOAPODS_CDN_MAX_NUMBER_OF_RETRIES'] || 5).to_i
# Single thread executor for all network activity.
HYDRA_EXECUTOR = Concurrent::SingleThreadExecutor.new
Expand Down Expand Up @@ -489,7 +490,7 @@ def concurrent_requests_catching_errors
end

def queue_request(request)
@hydra ||= Typhoeus::Hydra.new
@hydra ||= Typhoeus::Hydra.new(max_concurrency: MAX_CONCURRENCY)

# Queue the request into the Hydra (libcurl reactor).
@hydra.queue(request)
Expand Down

0 comments on commit beec95a

Please sign in to comment.