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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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