Skip to content
Snippets Groups Projects
Commit a372fd63 authored by Serban Iorga's avatar Serban Iorga Committed by Bastian Köcher
Browse files

Fix parachains_loop::tests::minimal_working_case

parent e97bb575
Branches
No related merge requests found
...@@ -24,7 +24,7 @@ use bp_polkadot_core::{ ...@@ -24,7 +24,7 @@ use bp_polkadot_core::{
}; };
use futures::{ use futures::{
future::{FutureExt, Shared}, future::{FutureExt, Shared},
poll, select, poll, select_biased,
}; };
use relay_substrate_client::{BlockNumberOf, Chain, HeaderIdOf}; use relay_substrate_client::{BlockNumberOf, Chain, HeaderIdOf};
use relay_utils::{ use relay_utils::{
...@@ -216,10 +216,12 @@ where ...@@ -216,10 +216,12 @@ where
// regular errors. // regular errors.
loop { loop {
// either wait for new block, or exit signal // Either wait for new block, or exit signal.
select! { // Please note that we are prioritizing the exit signal since if both events happen at once
_ = async_std::task::sleep(min_block_interval).fuse() => {}, // it doesn't make sense to perform one more loop iteration.
select_biased! {
_ = exit_signal => return Ok(()), _ = exit_signal => return Ok(()),
_ = async_std::task::sleep(min_block_interval).fuse() => {},
} }
// if source client is not yet synced, we'll need to sleep. Otherwise we risk submitting too // if source client is not yet synced, we'll need to sleep. Otherwise we risk submitting too
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment