Browse Source

Wait for message to be actually sent on the wire

fix-bad-api-calls
Thomas Eizinger 3 years ago
parent
commit
7ce5ea47df
No known key found for this signature in database GPG Key ID: 651AC83A6C6C8B96
  1. 4
      daemon/src/maker_cfd.rs
  2. 4
      daemon/src/maker_inc_connections.rs

4
daemon/src/maker_cfd.rs

@ -289,12 +289,14 @@ impl Actor {
.await
.unwrap();
// use `.send` here to ensure we only continue once the message has been sent
self.takers
.do_send_async(maker_inc_connections::TakerMessage {
.send(maker_inc_connections::TakerMessage {
taker_id,
command: TakerCommand::NotifyOrderAccepted { id: msg.order_id },
})
.await?;
self.cfd_feed_actor_inbox
.send(load_all_cfds(&mut conn).await?)?;

4
daemon/src/maker_inc_connections.rs

@ -61,7 +61,9 @@ impl Actor {
.write_connections
.get(&taker_id)
.context("no connection to taker_id")?;
conn.do_send_async(msg).await?;
// use `.send` here to ensure we only continue once the message has been sent
conn.send(msg).await?;
Ok(())
}

Loading…
Cancel
Save