[#1713] morph: Allow switch interval configuration

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-10-12 20:12:35 +03:00 committed by fyrchik
parent d09ec2e3fe
commit d240e2dc87
2 changed files with 16 additions and 5 deletions

View file

@ -133,9 +133,7 @@ func (c *Client) notificationLoop() {
}
func (c *Client) switchToMostPrioritized() {
const period = 2 * time.Minute
t := time.NewTicker(period)
t := time.NewTicker(c.cfg.switchInterval)
defer t.Stop()
defer c.switchIsActive.Store(false)