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)
|
defer close(ch)
|
||||||
go func() {
|
go func() {
|
||||||
t := time.NewTicker(time.Minute)
|
t := time.NewTicker(time.Minute)
|
||||||
|
defer t.Stop()
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ch:
|
case <-ch:
|
||||||
|
|
Loading…
Reference in New Issue