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:
jeff.ye
2026-06-08 22:48:31 -07:00
committed by GitHub
co-authored by mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent ebf53ba373
commit 7c2aa3108a
+1 -3
View File
@@ -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: ...