mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 09:48:05 +03:00
edenapi: move active transfer check into loop body
Summary: Due to the structure of this loop, we were unnecessarily blocking and polling when all curl transfers were already complete. To fix this, move the loop condition check to the middle of the loop. Reviewed By: quark-zju Differential Revision: D15124823 fbshipit-source-id: 92b7eee83cbfd62d590c21893f3235e1ca04fcec
This commit is contained in:
parent
7abc07832c
commit
77ac4bc5c2
@ -90,7 +90,7 @@ impl<H: Handler> MultiDriver<H> {
|
||||
let mut failed = Vec::new();
|
||||
let mut i = 0;
|
||||
|
||||
while in_progress > 0 {
|
||||
loop {
|
||||
log::trace!(
|
||||
"Iteration {}: {}/{} transfers complete",
|
||||
i,
|
||||
@ -126,6 +126,11 @@ impl<H: Handler> MultiDriver<H> {
|
||||
break;
|
||||
}
|
||||
|
||||
if in_progress == 0 {
|
||||
log::debug!("All transfers finished successfully.");
|
||||
break;
|
||||
}
|
||||
|
||||
let timeout = self.multi.get_timeout()?.unwrap_or(DEFAULT_TIMEOUT);
|
||||
log::trace!("Waiting for I/O with timeout: {:?}", &timeout);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user