Update crates/binstalk-fetchers/src/futures_resolver.rs

Co-authored-by: Félix Saparelli <felix@passcod.name>
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
Jiahao XU 2024-06-22 23:15:33 +10:00 committed by GitHub
parent e03b625046
commit fc0f4f3906
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -74,13 +74,13 @@ impl<T: Send + 'static, E: Send + Debug + 'static> FuturesResolver<T, E> {
drop(self.tx);
async move {
while let Some(res) = rx.recv().await {
match res {
Ok(ret) => return Some(ret),
Err(err) => warn!(?err, "Fail to resolve the future"),
}
loop {
match rx.recv().await {
Some(Ok(ret)) => return Some(ret),
Some(Err(err)) => warn!(?err, "Fail to resolve the future"),
None => return None,
}
}
None
}
}
}