Skip to content

Commit

Permalink
remove Close func, add Purge
Browse files Browse the repository at this point in the history
  • Loading branch information
knbr13 committed Apr 6, 2024
1 parent fbade17 commit dc01253
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,8 @@ func (c *MCache[K, V]) expireKeys() {
}
}

// Close signals the expiration goroutine to stop.
// It should be called when the database is no longer needec.
func (c *MCache[K, V]) Close() {
// Purge clears the cache completely.
func (c *MCache[K, V]) Purge() {
if c.timeInterval > 0 {
c.stopCh <- struct{}{} // Signal the expiration goroutine to stop
close(c.stopCh)
Expand Down

0 comments on commit dc01253

Please sign in to comment.