plugin/hosts: fix ticker leak in golang (#5690)

This commit is contained in:
Yong Tang
2022-10-11 09:26:45 -04:00
committed by GitHub
parent 4ae811ad96
commit c61e8f3dbc

View File

@@ -26,6 +26,7 @@ func periodicHostsUpdate(h *Hosts) chan bool {
go func() { go func() {
ticker := time.NewTicker(h.options.reload) ticker := time.NewTicker(h.options.reload)
defer ticker.Stop()
for { for {
select { select {
case <-parseChan: case <-parseChan: