lib/model: Add initial deviceStatRefs on model creation (fixes #6136) (#6137)

This is a regression introduced in PR #6005 / commit
f7b2e79fdc
This commit is contained in:
Simon Frei 2019-11-08 12:32:51 +01:00 committed by Audrius Butkevicius
parent bee7cce081
commit cd290d2d05

View File

@ -207,6 +207,9 @@ func NewModel(cfg config.Wrapper, id protocol.DeviceID, clientName, clientVersio
fmut: sync.NewRWMutex(), fmut: sync.NewRWMutex(),
pmut: sync.NewRWMutex(), pmut: sync.NewRWMutex(),
} }
for devID := range cfg.Devices() {
m.deviceStatRefs[devID] = stats.NewDeviceStatisticsReference(m.db, devID.String())
}
m.Add(m.progressEmitter) m.Add(m.progressEmitter)
scanLimiter.setCapacity(cfg.Options().MaxConcurrentScans) scanLimiter.setCapacity(cfg.Options().MaxConcurrentScans)
cfg.Subscribe(m) cfg.Subscribe(m)