Skip to content

Commit

Permalink
Resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
mertwole committed Aug 27, 2024
1 parent ec60c9f commit 245da03
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions relayer/src/message_relayer/event_listener.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::{
sync::mpsc::{channel, Receiver, Sender},
thread,
time::Duration,
};

Expand Down Expand Up @@ -105,7 +104,7 @@ impl EventListener {

current_block = finalized_head + 1;
} else {
thread::sleep(GEAR_BLOCK_TIME_APPROX);
tokio::time::sleep(GEAR_BLOCK_TIME_APPROX).await;
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions relayer/src/message_relayer/merkle_root_listener.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::{
sync::mpsc::{channel, Receiver, Sender},
thread,
time::Duration,
};

Expand Down Expand Up @@ -128,7 +127,7 @@ impl MerkleRootListener {
current_block = latest + 1;
self.metrics.latest_processed_block.inc();
} else {
thread::sleep(ETHEREUM_BLOCK_TIME_APPROX / 2)
tokio::time::sleep(ETHEREUM_BLOCK_TIME_APPROX / 2).await;
}
}
}
Expand Down
7 changes: 2 additions & 5 deletions relayer/src/relay_merkle_roots.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use prometheus::{Gauge, IntGauge};
use prover::proving::GenesisConfig;
use std::{
thread,
time::{Duration, Instant},
};
use std::time::{Duration, Instant};

use crate::{
proof_storage::ProofStorage,
Expand Down Expand Up @@ -108,7 +105,7 @@ impl MerkleRootRelayer {

let main_loop_duration = now.elapsed();
if main_loop_duration < MIN_MAIN_LOOP_DURATION {
thread::sleep(MIN_MAIN_LOOP_DURATION - main_loop_duration);
tokio::time::sleep(MIN_MAIN_LOOP_DURATION - main_loop_duration).await;
}
}
}
Expand Down

0 comments on commit 245da03

Please sign in to comment.