lib/model: Handle progress emitter zero interval (fixes #6281) (#6282)

Makes the logic a bit clearer and safer. This also sneakily redefines
the 0 interval to also mean disabled, whereas it previously meant ...
sometimes default to 1s, sometimes just spin.
This commit is contained in:
Jakob Borg
2020-01-20 21:14:29 +01:00
committed by GitHub
parent ddd26f5c42
commit d62a0cf692
2 changed files with 17 additions and 14 deletions
+2 -2
View File
@@ -62,7 +62,7 @@ func TestProgressEmitter(t *testing.T) {
c := createTmpWrapper(config.Configuration{})
defer os.Remove(c.ConfigPath())
c.SetOptions(config.OptionsConfiguration{
ProgressUpdateIntervalS: 0,
ProgressUpdateIntervalS: 60, // irrelevant, but must be positive
})
p := NewProgressEmitter(c, evLogger)
@@ -112,7 +112,7 @@ func TestSendDownloadProgressMessages(t *testing.T) {
c := createTmpWrapper(config.Configuration{})
defer os.Remove(c.ConfigPath())
c.SetOptions(config.OptionsConfiguration{
ProgressUpdateIntervalS: 0,
ProgressUpdateIntervalS: 60, // irrelevant, but must be positive
TempIndexMinBlocks: 10,
})