lib/model: Don't bump seq on error in index handler (#9459)

This commit is contained in:
Simon Frei 2024-03-11 07:30:21 +01:00 committed by GitHub
parent 73cc5553b6
commit 8c8167a4ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -293,7 +293,9 @@ func (s *indexHandler) sendIndexTo(ctx context.Context, fset *db.FileSet) error
return err return err
} }
err = batch.Flush() if err := batch.Flush(); err != nil {
return err
}
// Use the sequence of the snapshot we iterated as a starting point for the // 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, // next run. Previously we used the sequence of the last file we sent,
@ -302,7 +304,7 @@ func (s *indexHandler) sendIndexTo(ctx context.Context, fset *db.FileSet) error
// reverted). No point trying to send nothing again. // reverted). No point trying to send nothing again.
s.prevSequence = snap.Sequence(protocol.LocalDeviceID) s.prevSequence = snap.Sequence(protocol.LocalDeviceID)
return err return nil
} }
func (s *indexHandler) receive(fs []protocol.FileInfo, update bool, op string) error { func (s *indexHandler) receive(fs []protocol.FileInfo, update bool, op string) error {