mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-02 22:50:18 +00:00
lib/db: Hold update lock while taking snapshot (#9496)
This commit is contained in:
parent
faa56b4bb7
commit
2e7c03420f
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user