mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 02:48:59 +00:00
Explanation of what/why in a code comment. Fixes https://github.com/syncthing/syncthing/issues/9407
This commit is contained in:
parent
2ab2488274
commit
73cc5553b6
@ -295,12 +295,13 @@ func (s *indexHandler) sendIndexTo(ctx context.Context, fset *db.FileSet) error
|
||||
|
||||
err = batch.Flush()
|
||||
|
||||
// True if there was nothing to be sent
|
||||
if f.Sequence == 0 {
|
||||
return err
|
||||
}
|
||||
// Use the sequence of the snapshot we iterated as a starting point for the
|
||||
// next run. Previously we used the sequence of the last file we sent,
|
||||
// however it's possible that a higher sequence exists, just doesn't need to
|
||||
// be sent (e.g. in a receive-only folder, when a local change was
|
||||
// reverted). No point trying to send nothing again.
|
||||
s.prevSequence = snap.Sequence(protocol.LocalDeviceID)
|
||||
|
||||
s.prevSequence = f.Sequence
|
||||
return err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user