Skip to content

Commit

Permalink
do not rebroadcast diff sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Termina1 committed Nov 29, 2024
1 parent 6d96062 commit 2f84806
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,19 +562,21 @@ func (sync *Syncer) Drain(ctx context.Context, recs protocol.Records) (err error
fallthrough

case SendDiff:
broadcast := false
lit := LastLit(recs)
if lit != 'D' && lit != 'V' {
if lit == 'B' {
sync.SetDrainState(ctx, SendNone)
} else {
broadcast = true
sync.SetDrainState(ctx, SendLive)
}
}
if sync.Mode&SyncLive != 0 {
sync.resetPingTimer()
}
err = sync.Host.Drain(sync.logCtx(ctx), recs)
if err == nil {
if err == nil && broadcast {
sync.Host.Broadcast(sync.logCtx(ctx), recs, sync.Name)
}

Expand Down

0 comments on commit 2f84806

Please sign in to comment.