Skip to content

Commit 01585ba

Browse files
authored
chore: add missing stop ticker (#3161)
1 parent a33c80e commit 01585ba

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

share/p2p/discovery/backoff.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ func (b *backoffConnector) HasBackoff(p peer.ID) bool {
9191
// GC is a perpetual GCing loop.
9292
func (b *backoffConnector) GC(ctx context.Context) {
9393
ticker := time.NewTicker(gcInterval)
94+
defer ticker.Stop()
95+
9496
for {
9597
select {
9698
case <-ctx.Done():

0 commit comments

Comments
 (0)