bug: updater runs only 1 instance

buddies-main-deployment
James Prestwich 3 years ago
parent 858b670d3d
commit 49f0316ee6
No known key found for this signature in database
GPG Key ID: 7CC174C250AD83AD
  1. 9
      rust/agents/processor/src/processor.rs
  2. 3
      rust/agents/updater/src/main.rs

@ -149,10 +149,10 @@ impl Replica {
///
/// In case of error: send help?
#[instrument(err)]
async fn try_msg_by_domain_and_nonce(&self, domain: u32, nonce: u32) -> Result<bool> {
async fn try_msg_by_domain_and_nonce(&self, domain: u32, current_seq: u32) -> Result<bool> {
use optics_core::traits::Replica;
let message = match self.home.message_by_nonce(domain, nonce).await {
let message = match self.home.message_by_nonce(domain, current_seq).await {
Ok(Some(m)) => m,
Ok(None) => {
info!("Message not yet found");
@ -205,7 +205,10 @@ impl Replica {
sleep(Duration::from_secs(self.interval)).await;
}
info!("Dispatching a message for processing {}:{}", domain, nonce);
info!(
"Dispatching a message for processing {}:{}",
domain, current_seq
);
self.process(message, proof).await?;

@ -25,7 +25,8 @@ async fn _main() -> Result<()> {
let _ = agent.metrics().run_http_server();
agent.run_all().await?;
// this is deliberately different from other agents
agent.run("").await??;
Ok(())
}

Loading…
Cancel
Save