Skip to content

Commit

Permalink
Merge pull request #888 from fxfactorial/leak
Browse files Browse the repository at this point in the history
[discovery] missing defer .Stop on ticker
  • Loading branch information
Stebalien authored Apr 17, 2020
2 parents 6f4961b + 28f45ac commit 76b080c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion p2p/discovery/mdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ func (m *mdnsService) Close() error {
}

func (m *mdnsService) pollForEntries(ctx context.Context) {

ticker := time.NewTicker(m.interval)
defer ticker.Stop()

for {
//execute mdns query right away at method call and then with every tick
entriesCh := make(chan *mdns.ServiceEntry, 16)
Expand Down

0 comments on commit 76b080c

Please sign in to comment.