Skip to content

Commit f6efb6d

Browse files
committed
feat(dist/manifestation): adjust default concurrent downloads when installing toolchains
1 parent 654809a commit f6efb6d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/dist/manifestation.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,12 @@ impl Manifestation {
157157
let mut things_downloaded: Vec<String> = Vec::new();
158158
let components = update.components_urls_and_hashes(new_manifest)?;
159159
let components_len = components.len();
160+
161+
const DEFAULT_CONCURRENT_DOWNLOADS: usize = 2;
160162
let concurrent_downloads = download_cfg
161163
.process
162164
.concurrent_downloads()
163-
.unwrap_or(components_len);
165+
.unwrap_or(DEFAULT_CONCURRENT_DOWNLOADS);
164166

165167
const DEFAULT_MAX_RETRIES: usize = 3;
166168
let max_retries: usize = download_cfg
@@ -200,7 +202,7 @@ impl Manifestation {
200202
.await
201203
}
202204
});
203-
if concurrent_downloads > 0 {
205+
if components_len > 0 {
204206
let results = component_stream
205207
.buffered(components_len)
206208
.collect::<Vec<_>>()

0 commit comments

Comments
 (0)