mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 07:01:05 +00:00
remove flakiness (#5572)
This commit is contained in:
@@ -30,7 +30,7 @@ use std::time::Duration;
|
||||
#[cfg(not(test))]
|
||||
const BACKGROUND_REVALIDATION_INTERVAL: Duration = Duration::from_millis(200);
|
||||
#[cfg(test)]
|
||||
pub const BACKGROUND_REVALIDATION_INTERVAL: Duration = Duration::from_millis(5);
|
||||
pub const BACKGROUND_REVALIDATION_INTERVAL: Duration = Duration::from_millis(1);
|
||||
|
||||
const BACKGROUND_REVALIDATION_BATCH_SIZE: usize = 20;
|
||||
|
||||
@@ -214,12 +214,21 @@ impl<Api: ChainApi> RevalidationWorker<Api> {
|
||||
|
||||
loop {
|
||||
futures::select! {
|
||||
_ = interval.next() => {
|
||||
_guard = interval.next() => {
|
||||
let next_batch = this.prepare_batch();
|
||||
let batch_len = next_batch.len();
|
||||
|
||||
batch_revalidate(this.pool.clone(), this.api.clone(), this.best_block, next_batch).await;
|
||||
|
||||
#[cfg(test)]
|
||||
{
|
||||
use intervalier::Guard;
|
||||
// only trigger test events if something was processed
|
||||
if batch_len == 0 {
|
||||
_guard.expect("Always some() in tests").skip();
|
||||
}
|
||||
}
|
||||
|
||||
if batch_len > 0 || this.len() > 0 {
|
||||
log::debug!(
|
||||
target: "txpool",
|
||||
|
||||
Reference in New Issue
Block a user