Skip to content

Commit

Permalink
chore: add missing stop ticker (#3161)
Browse files Browse the repository at this point in the history
  • Loading branch information
htiennv authored Feb 5, 2024
1 parent a33c80e commit 01585ba
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions share/p2p/discovery/backoff.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ func (b *backoffConnector) HasBackoff(p peer.ID) bool {
// GC is a perpetual GCing loop.
func (b *backoffConnector) GC(ctx context.Context) {
ticker := time.NewTicker(gcInterval)
defer ticker.Stop()

for {
select {
case <-ctx.Done():
Expand Down

0 comments on commit 01585ba

Please sign in to comment.