chanfitness/chaneventstore: stop ticker after goroutine
Stop the ticker after the goroutine reading from it has exited, to avoid triggering the race detector.
This commit is contained in:
parent
9e4cfa0182
commit
c1705a28da
@ -203,12 +203,13 @@ func (c *ChannelEventStore) Start() error {
|
|||||||
func (c *ChannelEventStore) Stop() {
|
func (c *ChannelEventStore) Stop() {
|
||||||
log.Info("Stopping event store")
|
log.Info("Stopping event store")
|
||||||
|
|
||||||
c.cfg.FlapCountTicker.Stop()
|
|
||||||
|
|
||||||
// Stop the consume goroutine.
|
// Stop the consume goroutine.
|
||||||
close(c.quit)
|
close(c.quit)
|
||||||
|
|
||||||
c.wg.Wait()
|
c.wg.Wait()
|
||||||
|
|
||||||
|
// Stop the ticker after the goroutine reading from it has exited, to
|
||||||
|
// avoid a race.
|
||||||
|
c.cfg.FlapCountTicker.Stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
// addChannel checks whether we are already tracking a channel's peer, creates a
|
// addChannel checks whether we are already tracking a channel's peer, creates a
|
||||||
|
Loading…
Reference in New Issue
Block a user