lib/model: Remove syncthing-specific files (fixes #3819)
Syncthing adds some hidden files when a folder is added, but there is currently no equivalent cleanup procedure. This change is conservative as not to accidentally cause data loss. GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3874
This commit is contained in:
parent
fe377a166a
commit
8d2a31e38e
@ -330,6 +330,11 @@ func (m *Model) RemoveFolder(folder string) {
|
|||||||
m.fmut.Lock()
|
m.fmut.Lock()
|
||||||
m.pmut.Lock()
|
m.pmut.Lock()
|
||||||
|
|
||||||
|
// Delete syncthing specific files
|
||||||
|
folderCfg := m.folderCfgs[folder]
|
||||||
|
folderPath := folderCfg.Path()
|
||||||
|
os.Remove(filepath.Join(folderPath, ".stfolder"))
|
||||||
|
|
||||||
m.tearDownFolderLocked(folder)
|
m.tearDownFolderLocked(folder)
|
||||||
// Remove it from the database
|
// Remove it from the database
|
||||||
db.DropFolder(m.db, folder)
|
db.DropFolder(m.db, folder)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user