Skip to content

Commit c5cdd25

Browse files
committed
Auto merge of #10456 - hi-rustin:rustin-patch-network, r=alexcrichton
Wait up to one second while waiting for curl ### What does this PR try to resolve? close #8516 Wait up to one second while waiting for curl. ### How should we test and review this PR? 1. Build cargo 2. Start a network transfer (cargo fetch). 3. Pull the network cord. 4. Wait.
2 parents 865cd5a + b68bf77 commit c5cdd25

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/cargo/core/package.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,11 +1000,9 @@ impl<'a, 'cfg> Downloads<'a, 'cfg> {
10001000
break Ok(pair);
10011001
}
10021002
assert!(!self.pending.is_empty());
1003-
let timeout = self
1004-
.set
1005-
.multi
1006-
.get_timeout()?
1007-
.unwrap_or_else(|| Duration::new(5, 0));
1003+
let min_timeout = Duration::new(1, 0);
1004+
let timeout = self.set.multi.get_timeout()?.unwrap_or(min_timeout);
1005+
let timeout = timeout.min(min_timeout);
10081006
self.set
10091007
.multi
10101008
.wait(&mut [], timeout)

0 commit comments

Comments
 (0)