fix time.Ticker leak
This commit is contained in:
parent
c0a1c3bf43
commit
771c8c136e
@ -149,6 +149,7 @@ func (Channel) Time(ctx *server.Context, interval time.Duration) error {
|
|||||||
case t := <-tick.C:
|
case t := <-tick.C:
|
||||||
ch <- t
|
ch <- t
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
|
tick.Stop()
|
||||||
close(ch)
|
close(ch)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user