mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 10:28:49 -07:00
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.pmut.Lock()
|
||||
|
||||
// Delete syncthing specific files
|
||||
folderCfg := m.folderCfgs[folder]
|
||||
folderPath := folderCfg.Path()
|
||||
os.Remove(filepath.Join(folderPath, ".stfolder"))
|
||||
|
||||
m.tearDownFolderLocked(folder)
|
||||
// Remove it from the database
|
||||
db.DropFolder(m.db, folder)
|
||||
|
Loading…
Reference in New Issue
Block a user