Skip to content

Commit

Permalink
Backport FnCache.Remove
Browse files Browse the repository at this point in the history
  • Loading branch information
espadolini committed Dec 16, 2024
1 parent c0c3ece commit 675d055
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/utils/fncache.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ func (c *FnCache) Shutdown(ctx context.Context) {
}
}

// Remove purges a specific item in the cache.
func (c *FnCache) Remove(key any) {
c.mu.Lock()
defer c.mu.Unlock()
delete(c.entries, key)
}

// RemoveExpired purges any items from the cache which have exceeded their TTL.
func (c *FnCache) RemoveExpired() {
c.mu.Lock()
Expand Down

0 comments on commit 675d055

Please sign in to comment.