lib/model: More connection closing (#6778)

* lib/model: More connection closing

* Revert "lib/model: More connection closing"

This reverts commit 5397c3a55c.

* Add tests, fix one broken-ness

* Update lib/model/model.go

Co-authored-by: Simon Frei <freisim93@gmail.com>

* Update model.go

* Update model.go

Co-authored-by: Simon Frei <freisim93@gmail.com>
This commit is contained in:
Audrius Butkevicius
2020-06-22 21:26:26 +01:00
committed by GitHub
co-authored by Simon Frei
parent b62b7d269e
commit 5fb3992275
2 changed files with 119 additions and 1 deletions
+4 -1
View File
@@ -492,7 +492,10 @@ func (m *model) restartFolder(from, to config.FolderConfiguration) {
fset = db.NewFileSet(to.ID, to.Filesystem(), m.db)
}
m.stopFolder(from, fmt.Errorf("%v folder %v", errMsg, to.Description()))
err := fmt.Errorf("%v folder %v", errMsg, to.Description())
m.stopFolder(from, err)
// Need to send CC change to both from and to devices.
m.closeConns(to.DeviceIDs(), err)
m.fmut.Lock()
defer m.fmut.Unlock()