fix(timer_module): Ensure that interval > 0 (#2274)

Since 3.5.0, we use m_interval for a modulo operation, this crashes the
bar if the interval is 0. A non-positive interval shouldn't be allowed
anyway, so we now throw an exception in that case.

Fixes #2273
This commit is contained in:
Patrick Ziegler
2020-12-05 22:58:38 +01:00
committed by GitHub
parent b2c515c73c
commit 82ebad5e7a
9 changed files with 23 additions and 9 deletions

View File

@ -19,7 +19,7 @@ namespace modules {
m_ping_nth_update = m_conf.get(name(), "ping-interval", m_ping_nth_update);
m_udspeed_minwidth = m_conf.get(name(), "udspeed-minwidth", m_udspeed_minwidth);
m_accumulate = m_conf.get(name(), "accumulate-stats", m_accumulate);
m_interval = m_conf.get<decltype(m_interval)>(name(), "interval", 1s);
set_interval(1s);
m_unknown_up = m_conf.get<bool>(name(), "unknown-as-up", false);
m_conf.warn_deprecated(name(), "udspeed-minwidth", "%downspeed:min:max% and %upspeed:min:max%");