refactor: simplify getValueInterface function (#5280)

This commit is contained in:
Kevin Wan
2025-11-16 20:36:49 +08:00
committed by GitHub
parent c7065171d7
commit 75941aedd4
3 changed files with 153 additions and 18 deletions

View File

@@ -81,6 +81,10 @@ func (c *Cache) Del(key string) {
delete(c.data, key)
c.lruCache.remove(key)
c.lock.Unlock()
// RemoveTimer is called outside the lock to avoid performance impact from this
// potentially time-consuming operation. Data integrity is maintained by lruCache,
// which will eventually evict any remaining entries when capacity is exceeded.
c.timingWheel.RemoveTimer(key)
}