Stop the ticker when goroutine exits
parent
4556d6738a
commit
5d3d562ecc
|
@ -100,6 +100,7 @@ func (c *Consumer) runOnce(ctx context.Context) error {
|
|||
defer close(ch)
|
||||
go func() {
|
||||
t := time.NewTicker(time.Minute)
|
||||
defer t.Stop()
|
||||
for {
|
||||
select {
|
||||
case <-ch:
|
||||
|
|
Loading…
Reference in New Issue