mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-08 22:31:04 +00:00
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()
|
||||
defer m.fmut.Unlock()
|
||||
|
||||
// Delete syncthing specific files
|
||||
cfg.Filesystem().RemoveAll(config.DefaultMarkerName)
|
||||
isPathUnique := true
|
||||
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()))
|
||||
// Remove it from the database
|
||||
|
Loading…
Reference in New Issue
Block a user