mirror of
https://github.com/syncthing/syncthing.git
synced 2026-04-13 19:07:36 -04:00
lib/db: Hold update lock while taking snapshot (#9496)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user