Skip to content

Commit

Permalink
use tokio::sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
oxarbitrage committed Nov 24, 2023
1 parent 27d2936 commit 404236e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion zebra-scan/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ zebra-state = { path = "../zebra-state", version = "1.0.0-beta.31" }
color-eyre = "0.6.2"
indexmap = { version = "2.0.1", features = ["serde"] }
serde = { version = "1.0.192", features = ["serde_derive"] }
tokio = { version = "1.34.0", features = ["test-util"] }
tower = "0.4.13"
tracing = "0.1.39"

Expand All @@ -39,6 +40,5 @@ bls12_381 = "0.8.0"
jubjub = "0.10.0"
ff = "0.13.0"
group = "0.13.0"
tokio = { version = "1.34.0", features = ["test-util"] }

zebra-test = { path = "../zebra-test" }
4 changes: 2 additions & 2 deletions zebra-scan/src/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const CHECK_INTERVAL: Duration = Duration::from_secs(10);
/// - Real scanning code functionality will be added in the future here.
pub async fn start(mut state: State, storage: Storage) -> Result<(), Report> {
// We want to make sure the state has a tip height available before we start scanning.
std::thread::sleep(INITIAL_WAIT);
tokio::time::sleep(INITIAL_WAIT).await;

loop {
// Make sure we can query the state
Expand All @@ -53,6 +53,6 @@ pub async fn start(mut state: State, storage: Storage) -> Result<(), Report> {
);
}

std::thread::sleep(CHECK_INTERVAL);
tokio::time::sleep(CHECK_INTERVAL).await;
}
}

0 comments on commit 404236e

Please sign in to comment.