Clear timer in case currently set

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
Ivan Kozlovic
2021-03-13 14:59:38 -07:00
parent 9e858ff81f
commit 5edb8b1105

View File

@@ -713,6 +713,7 @@ func (o *consumer) setLeader(isLeader bool) {
// There is no local interest, but there is GW interest, we
// will watch for interest disappearing.
// TODO: may need to revisit...
stopAndClearTimer(&o.gwdtmr)
o.gwdtmr = time.AfterFunc(o.dthresh, func() { o.watchGWinterest() })
}
}