mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-22 22:58:25 +00:00
This commit is contained in:
parent
5de9b677c2
commit
35f40e9a58
@ -459,18 +459,16 @@ func (m *model) RestartFolder(from, to config.FolderConfiguration) {
|
|||||||
errMsg = "restarting"
|
errMsg = "restarting"
|
||||||
}
|
}
|
||||||
|
|
||||||
var fset *db.FileSet
|
|
||||||
if !to.Paused {
|
|
||||||
// Creating the fileset can take a long time (metadata calculation)
|
|
||||||
// so we do it outside of the lock.
|
|
||||||
fset = db.NewFileSet(to.ID, to.Filesystem(), m.db)
|
|
||||||
}
|
|
||||||
|
|
||||||
m.fmut.Lock()
|
m.fmut.Lock()
|
||||||
defer m.fmut.Unlock()
|
defer m.fmut.Unlock()
|
||||||
|
|
||||||
m.tearDownFolderLocked(from, fmt.Errorf("%v folder %v", errMsg, to.Description()))
|
m.tearDownFolderLocked(from, fmt.Errorf("%v folder %v", errMsg, to.Description()))
|
||||||
if !to.Paused {
|
if !to.Paused {
|
||||||
|
// Creating the fileset can take a long time (metadata calculation)
|
||||||
|
// so we do it outside of the lock.
|
||||||
|
m.fmut.Unlock()
|
||||||
|
fset := db.NewFileSet(to.ID, to.Filesystem(), m.db)
|
||||||
|
m.fmut.Lock()
|
||||||
m.addFolderLocked(to, fset)
|
m.addFolderLocked(to, fset)
|
||||||
m.startFolderLocked(to)
|
m.startFolderLocked(to)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user