lib/model: Also handle ServeBackground (#6173)

This commit is contained in:
Simon Frei
2019-11-22 21:30:16 +01:00
committed by GitHub
parent de886b3f22
commit 65d4dd32cb
4 changed files with 29 additions and 22 deletions

View File

@@ -219,6 +219,16 @@ func NewModel(cfg config.Wrapper, id protocol.DeviceID, clientName, clientVersio
}
func (m *model) Serve() {
m.onServe()
m.Supervisor.Serve()
}
func (m *model) ServeBackground() {
m.onServe()
m.Supervisor.ServeBackground()
}
func (m *model) onServe() {
// Add and start folders
for _, folderCfg := range m.cfg.Folders() {
if folderCfg.Paused {
@@ -227,7 +237,6 @@ func (m *model) Serve() {
}
m.newFolder(folderCfg)
}
m.Supervisor.Serve()
}
func (m *model) Stop() {