diff --git a/lib/db/set.go b/lib/db/set.go index 84cfb3452..fb4a9fda5 100644 --- a/lib/db/set.go +++ b/lib/db/set.go @@ -168,6 +168,10 @@ type Snapshot struct { func (s *FileSet) Snapshot() (*Snapshot, error) { opStr := fmt.Sprintf("%s Snapshot()", s.folder) l.Debugf(opStr) + + s.updateMutex.Lock() + defer s.updateMutex.Unlock() + t, err := s.db.newReadOnlyTransaction() if err != nil { s.db.handleFailure(err)