From 6bcede1a54a3380bd562361d721b7c9ae4e8ebbf Mon Sep 17 00:00:00 2001 From: Joseph Livesey Date: Mon, 31 Jul 2023 06:34:01 -0400 Subject: [PATCH] fix: init perftest subscriber ahead of submissions task Signed-off-by: Joseph Livesey --- crates/chronicle/src/bootstrap/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/chronicle/src/bootstrap/mod.rs b/crates/chronicle/src/bootstrap/mod.rs index 6929114e4..5b81a782f 100644 --- a/crates/chronicle/src/bootstrap/mod.rs +++ b/crates/chronicle/src/bootstrap/mod.rs @@ -499,6 +499,8 @@ where let perftest_ops_api = api.clone(); let start_time = Instant::now(); + let mut tx_notifications = api.notify_commit.subscribe(); + tokio::task::spawn(async move { while ops > 0 { let identity = AuthId::chronicle(); @@ -508,7 +510,6 @@ where } }); - let mut tx_notifications = api.notify_commit.subscribe(); while ops > 0 { if let Ok(SubmissionStage::Committed(_, _)) = tx_notifications.recv().await { ops -= 1;