Skip to content

Commit

Permalink
Await committed work
Browse files Browse the repository at this point in the history
  • Loading branch information
maplant committed Jan 18, 2024
1 parent 9e076d1 commit 51763b5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions mobile_verifier/src/heartbeats/cbrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,19 @@ where
&mut transaction,
)
.await?;
self.heartbeat_sink.commit().await?;
self.seniority_sink.commit().await?;
// Ensure that we have committed our work:
tokio::try_join!(self.commit_heartbeat_sink(), self.commit_seniority_sink())?;
transaction.commit().await?;
Ok(())
}

async fn commit_heartbeat_sink(&self) -> anyhow::Result<()> {
self.heartbeat_sink.commit().await?.await??;
Ok(())
}

async fn commit_seniority_sink(&self) -> anyhow::Result<()> {
self.heartbeat_sink.commit().await?.await??;
Ok(())
}
}

0 comments on commit 51763b5

Please sign in to comment.