Skip to content

Commit

Permalink
Fetch from DB before spawning tasks (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzejkop authored Mar 1, 2024
1 parent 70fc04b commit 1eef991
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/mpc_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ async fn main() -> eyre::Result<()> {
let mut tasks: Vec<JoinHandle<eyre::Result<()>>> = vec![];

if let Some(coordinator) = config.coordinator {
tasks.push(tokio::spawn(async move {
let coordinator = Arc::new(Coordinator::new(coordinator).await?);
let coordinator = Arc::new(Coordinator::new(coordinator).await?);

tasks.push(tokio::spawn(async move {
coordinator.spawn().await?;

Ok(())
}));
}

if let Some(participant) = config.participant {
tasks.push(tokio::spawn(async move {
let participant = Arc::new(Participant::new(participant).await?);
let participant = Arc::new(Participant::new(participant).await?);

tasks.push(tokio::spawn(async move {
participant.spawn().await?;

Ok(())
Expand Down

0 comments on commit 1eef991

Please sign in to comment.