Skip to content

Commit 2273652

Browse files
authored
Fix doCleanup goroutine leak in ttlcache.Cache (#11)
1 parent 1f4fabb commit 2273652

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

internal/ttlcache/ttlcache.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ func (c *Cache[K, V]) doCleanup(interval time.Duration, stop <-chan struct{}) {
111111
c.DeleteExpired()
112112
case <-stop:
113113
ticker.Stop()
114+
return
114115
}
115116
}
116117
}

0 commit comments

Comments
 (0)