From 4a86e6301b32a51d6d6861cdc33a5085fce6bbaf Mon Sep 17 00:00:00 2001 From: James Prestwich Date: Tue, 7 Sep 2021 15:48:39 -0700 Subject: [PATCH] chore: remove unused param from prover_sync spawn --- rust/agents/processor/src/processor.rs | 14 ++++++-------- rust/agents/processor/src/prover_sync.rs | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/rust/agents/processor/src/processor.rs b/rust/agents/processor/src/processor.rs index 046ab7bcf..2843201a3 100644 --- a/rust/agents/processor/src/processor.rs +++ b/rust/agents/processor/src/processor.rs @@ -231,7 +231,7 @@ impl Replica { self.replica.process(message.as_ref()).await?; } MessageStatus::Processed => { - warn!(target: "possible_race_condition", "Message {idx} already processed", idx = message.leaf_index); + warn!(target: "possible_race_condition", "Message {domain}:{idx} already processed", domain = message.message.destination, idx = message.leaf_index); } // Indicates race condition? } @@ -326,16 +326,14 @@ impl OpticsAgent for Processor { #[tracing::instrument(err)] async fn run_many(&self, replicas: &[&str]) -> Result<()> { let (_tx, rx) = channel(); - let interval = self.interval; info!("Starting ProverSync task"); let sync = ProverSync::new(self.prover.clone(), self.home(), self.db(), rx); - let sync_task = tokio::spawn(async move { - sync.spawn(interval) - .await - .wrap_err("ProverSync task has shut down") - }) - .in_current_span(); + let sync_task = + tokio::spawn( + async move { sync.spawn().await.wrap_err("ProverSync task has shut down") }, + ) + .in_current_span(); // for each specified replica, spawn a joinable task let mut handles: Vec<_> = replicas.iter().map(|name| self.run(name)).collect(); diff --git a/rust/agents/processor/src/prover_sync.rs b/rust/agents/processor/src/prover_sync.rs index 08c59ccf9..1e7a1ecc1 100644 --- a/rust/agents/processor/src/prover_sync.rs +++ b/rust/agents/processor/src/prover_sync.rs @@ -263,7 +263,7 @@ impl ProverSync { /// new root. Use short interval for bootup syncing and longer /// interval for regular polling. #[tracing::instrument(err, skip(self))] - pub async fn spawn(mut self, interval_seconds: u64) -> Result<(), ProverSyncError> { + pub async fn spawn(mut self) -> Result<(), ProverSyncError> { loop { let local_root = self.local_root().await; let signed_update_opt = self.home.signed_update_by_old_root(local_root).await?;