lib/model: Refactor progressEmitter to de-/activate by config (fixes #4613) (#5623)

This commit is contained in:
Simon Frei
2019-04-13 14:20:51 +02:00
committed by GitHub
parent 8a4b65b937
commit 3bea59b0d9
4 changed files with 152 additions and 116 deletions

View File

@@ -218,9 +218,7 @@ func NewModel(cfg config.Wrapper, id protocol.DeviceID, clientName, clientVersio
fmut: sync.NewRWMutex(),
pmut: sync.NewRWMutex(),
}
if cfg.Options().ProgressUpdateIntervalS > -1 {
m.Add(m.progressEmitter)
}
m.Add(m.progressEmitter)
scanLimiter.setCapacity(cfg.Options().MaxConcurrentScans)
cfg.Subscribe(m)