lib/model: Fix removal of a marker when there are still folders referencing it (#6114)
This commit is contained in:
parent
56cdf2f2d9
commit
3b5dff3f34
@ -389,8 +389,17 @@ func (m *model) RemoveFolder(cfg config.FolderConfiguration) {
|
|||||||
m.fmut.Lock()
|
m.fmut.Lock()
|
||||||
defer m.fmut.Unlock()
|
defer m.fmut.Unlock()
|
||||||
|
|
||||||
// Delete syncthing specific files
|
isPathUnique := true
|
||||||
cfg.Filesystem().RemoveAll(config.DefaultMarkerName)
|
for folderID, folderCfg := range m.folderCfgs {
|
||||||
|
if folderID != cfg.ID && folderCfg.Path == cfg.Path {
|
||||||
|
isPathUnique = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if isPathUnique {
|
||||||
|
// Delete syncthing specific files
|
||||||
|
cfg.Filesystem().RemoveAll(config.DefaultMarkerName)
|
||||||
|
}
|
||||||
|
|
||||||
m.tearDownFolderLocked(cfg, fmt.Errorf("removing folder %v", cfg.Description()))
|
m.tearDownFolderLocked(cfg, fmt.Errorf("removing folder %v", cfg.Description()))
|
||||||
// Remove it from the database
|
// Remove it from the database
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user