Skip to content

Commit

Permalink
change futures to for
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Druzhitskiy committed Aug 11, 2023
1 parent 8729dbe commit 12f1ac2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions bob-backend/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,8 @@ impl Backend {
let mut all_result = Err(Error::key_not_found(key));
if let Some(paths) = disk_paths {
trace!("GET[{}] try read normal", key);
let mut futures: FuturesUnordered<_> = paths.into_iter().map(|path| {
self.get_local(key, Operation::new_local(vdisk_id, path))
}).collect();
while let Some(result) = futures.next().await {
for path in paths {
let result = self.get_local(key, Operation::new_local(vdisk_id, path)).await;
match result {
Ok(data) => return Ok(data),
Err(_) => continue,
Expand Down

0 comments on commit 12f1ac2

Please sign in to comment.