Skip to content

Commit ed42621

Browse files
authored
Merge pull request #773 from maikelvdh/cdn-concurrency
Allow configuring CDN requests max concurrency to reduce flakiness
2 parents 80717cc + 6ca8cce commit ed42621

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
##### Enhancements
66

7-
* None.
7+
* Add ability to configure max concurrency of CDN requests through environment variable.
8+
[maikelvdh](https://github.com/maikelvdh)
9+
[#773](https://github.com/CocoaPods/Core/pull/773)
810

911
##### Bug Fixes
1012

lib/cocoapods-core/cdn_source.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module Pod
1010
class CDNSource < Source
1111
include Concurrent
1212

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

491492
def queue_request(request)
492-
@hydra ||= Typhoeus::Hydra.new
493+
@hydra ||= Typhoeus::Hydra.new(:max_concurrency => MAX_CONCURRENCY)
493494

494495
# Queue the request into the Hydra (libcurl reactor).
495496
@hydra.queue(request)

0 commit comments

Comments
 (0)