diff options
Diffstat (limited to 'src/swarm/peer/epoch.rs')
| -rw-r--r-- | src/swarm/peer/epoch.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/swarm/peer/epoch.rs b/src/swarm/peer/epoch.rs index 56711b1..d00a903 100644 --- a/src/swarm/peer/epoch.rs +++ b/src/swarm/peer/epoch.rs @@ -6,7 +6,6 @@ use tracing::{debug, info, warn}; use crate::document::replica::{Epoch, EpochRelation}; use crate::state::AppState; -use crate::swarm::sync::SyncEvent; use crate::transport; /// Records the epoch a peer advertised and compares it with ours. Returns true when the @@ -14,7 +13,8 @@ use crate::transport; /// /// `seq` is the peer's `epoch_seq` with it. A message with a lower one than we have was /// sent before the peer's last epoch change and delivered late: its epoch isn't -/// recorded, so it can't flip our view of the peer back. The count starts over when the +/// recorded, so it can't flip our view of the peer back. The message itself still +/// counts: if its epoch is ours, its sync is applied (it is data of our epoch). The count starts over when the /// peer restarts, which its HELLO or HELLO_REPLY tells by a new run (`run`). pub(super) async fn observe_peer_epoch( state: &AppState, @@ -66,9 +66,7 @@ pub(super) async fn observe_peer_epoch( EpochRelation::Same => { if previous.is_some() { info!(peer = %peer, epoch = %remote, "Peer is on our epoch again; resuming sync"); - let _ = state - .sync_events - .send(SyncEvent::PeerNeedsSync(peer.to_owned())); + state.request_sync(peer); } } // Expected after a remake: either side switches or catches up. |
