mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-10-15 04:18:03 +00:00
fixup! fixup! Further pursue of perfection.
This commit is contained in:
@@ -144,9 +144,17 @@ func (c *Cache) Delete(key string) {
|
||||
// This method is called automatically by the background cleanup task but can also
|
||||
// be called manually for immediate cleanup of expired entries.
|
||||
func (c *Cache) Cleanup() {
|
||||
if c == nil {
|
||||
return
|
||||
}
|
||||
|
||||
c.mutex.Lock()
|
||||
defer c.mutex.Unlock()
|
||||
|
||||
if c.items == nil {
|
||||
return
|
||||
}
|
||||
|
||||
now := time.Now()
|
||||
for key, item := range c.items {
|
||||
if now.After(item.ExpiresAt) {
|
||||
|
||||
Reference in New Issue
Block a user