File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -634,9 +634,16 @@ def devcmdrun?
634
634
sig { returns ( Integer ) }
635
635
def download_concurrency
636
636
# TODO: document this variable when ready to publicly announce it.
637
- concurrency = ENV . fetch ( "HOMEBREW_DOWNLOAD_CONCURRENCY" , 1 ) . to_i
638
- concurrency = 1 if concurrency <= 1
639
- concurrency
637
+ concurrency = ENV . fetch ( "HOMEBREW_DOWNLOAD_CONCURRENCY" , 1 )
638
+ concurrency = if concurrency == "auto"
639
+ require "os"
640
+ require "hardware"
641
+ Hardware ::CPU . cores * 2
642
+ else
643
+ concurrency . to_i
644
+ end
645
+
646
+ [ concurrency , 1 ] . max
640
647
end
641
648
end
642
649
end
Original file line number Diff line number Diff line change
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module Homebrew
5
+ module EnvConfig
6
+ include Kernel
7
+ end
8
+ end
You can’t perform that action at this time.
0 commit comments