Skip to content

Commit

Permalink
send clock a little later in sync process
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegn committed Aug 24, 2023
1 parent 130e71e commit 6003b5f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/corro-agent/src/api/peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,12 +562,6 @@ pub async fn bidirectional_sync(
.await
.map_err(|_| SyncSendError::ChannelClosed)?;

tx.send(SyncMessage::V1(SyncMessageV1::Clock(
agent.clock().new_timestamp().into(),
)))
.await
.map_err(|_| SyncSendError::ChannelClosed)?;

let (_sent_count, recv_count) = tokio::try_join!(
async move {
let mut count = 0;
Expand Down Expand Up @@ -617,6 +611,12 @@ pub async fn bidirectional_sync(

let their_actor_id = their_sync_state.actor_id;

tx.send(SyncMessage::V1(SyncMessageV1::Clock(
agent.clock().new_timestamp().into(),
)))
.await
.map_err(|_| SyncSendError::ChannelClosed)?;

tokio::spawn(
process_sync(
agent.actor_id(),
Expand Down

0 comments on commit 6003b5f

Please sign in to comment.