mirror of
https://github.com/rust-lang/cargo
synced 2024-08-28 19:59:27 +00:00
Wait up to one second while waiting for curl
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
This commit is contained in:
parent
71b71cc7e1
commit
b68bf77840
|
@ -1000,11 +1000,9 @@ impl<'a, 'cfg> Downloads<'a, 'cfg> {
|
|||
break Ok(pair);
|
||||
}
|
||||
assert!(!self.pending.is_empty());
|
||||
let timeout = self
|
||||
.set
|
||||
.multi
|
||||
.get_timeout()?
|
||||
.unwrap_or_else(|| Duration::new(5, 0));
|
||||
let min_timeout = Duration::new(1, 0);
|
||||
let timeout = self.set.multi.get_timeout()?.unwrap_or(min_timeout);
|
||||
let timeout = timeout.min(min_timeout);
|
||||
self.set
|
||||
.multi
|
||||
.wait(&mut [], timeout)
|
||||
|
|
Loading…
Reference in a new issue