chore: remove unused param from prover_sync spawn

buddies-main-deployment
James Prestwich 3 years ago
parent 49f0316ee6
commit 4a86e6301b
No known key found for this signature in database
GPG Key ID: 7CC174C250AD83AD
  1. 14
      rust/agents/processor/src/processor.rs
  2. 2
      rust/agents/processor/src/prover_sync.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();

@ -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?;

Loading…
Cancel
Save