fix: prevent MM cache hang from stale LRU order keys (#43595)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
ebf53ba373
commit
7c2aa3108a
+1
-3
@@ -118,10 +118,8 @@ class LRUCache(cachetools.LRUCache[_K, _V]):
|
||||
return info
|
||||
|
||||
def touch(self, key: _K) -> None:
|
||||
try:
|
||||
if key in self:
|
||||
self._LRUCache__order.move_to_end(key) # type: ignore
|
||||
except KeyError:
|
||||
self._LRUCache__order[key] = None # type: ignore
|
||||
|
||||
@overload
|
||||
def get(self, key: _K, /) -> _V | None: ...
|
||||
|
||||
Reference in New Issue
Block a user