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:
committed by
Jakob Borg
parent
283c8d95e2
commit
e85ce7c94e
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user