lib/model: Support removing paused folders (fixes #4357)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4358
LGTM: imsodin, calmh
This commit is contained in:
Audrius Butkevicius
2017-09-09 15:08:59 +00:00
committed by Jakob Borg
parent 283c8d95e2
commit e85ce7c94e
2 changed files with 54 additions and 1 deletions

View File

@@ -334,7 +334,14 @@ func (m *Model) RemoveFolder(folder string) {
m.pmut.Lock()
// Delete syncthing specific files
folderCfg := m.folderCfgs[folder]
folderCfg, ok := m.folderCfgs[folder]
if !ok {
// Folder might be paused
folderCfg, ok = m.cfg.Folder(folder)
}
if !ok {
panic("bug: remove non existing folder")
}
fs := folderCfg.Filesystem()
fs.RemoveAll(".stfolder")