Skip to content

Commit b68bf77

Browse files
committed
Wait up to one second while waiting for curl
Signed-off-by: hi-rustin <[email protected]>
1 parent 71b71cc commit b68bf77

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)