@@ -344,10 +344,14 @@ func (m *Model) RemoveFolder(cfg config.FolderConfiguration) {
|
||||
}
|
||||
|
||||
func (m *Model) tearDownFolderLocked(cfg config.FolderConfiguration) {
|
||||
// Stop the services running for this folder
|
||||
for _, id := range m.folderRunnerTokens[cfg.ID] {
|
||||
m.Remove(id)
|
||||
// Stop the services running for this folder and wait for them to finish
|
||||
// stopping to prevent races on restart.
|
||||
tokens := m.folderRunnerTokens[cfg.ID]
|
||||
m.fmut.Unlock()
|
||||
for _, id := range tokens {
|
||||
m.RemoveAndWait(id, 0)
|
||||
}
|
||||
m.fmut.Lock()
|
||||
|
||||
// Close connections to affected devices
|
||||
for _, dev := range cfg.Devices {
|
||||
|
||||
Reference in New Issue
Block a user