Skip to content

Commit

Permalink
fix futures
Browse files Browse the repository at this point in the history
  • Loading branch information
zorancv committed Dec 6, 2024
1 parent e657797 commit d8eb30e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions graph/src/blockchain/block_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,13 +546,16 @@ impl<C: Blockchain> TriggersAdapterWrapper<C> {
return self.adapter.chain_head_ptr().await;
}

let ptr = self
.source_subgraph_stores
.iter()
.filter_map(|(_, store)| store.block_ptr())
.min_by_key(|ptr| ptr.number);
let ptrs = futures03::future::try_join_all(
self.source_subgraph_stores
.iter()
.map(|(_, store)| store.block_ptr()),
)
.await?;

let min_ptr = ptrs.into_iter().flatten().min_by_key(|ptr| ptr.number);

Ok(ptr)
Ok(min_ptr)
}
}

Expand Down

0 comments on commit d8eb30e

Please sign in to comment.