Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Rename AsyncLruCache.lru_cache -> AsyncLruCache._lru_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar committed Jul 14, 2022
1 parent ec33b99 commit f04a949
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions synapse/util/caches/lrucache.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,24 +740,24 @@ class AsyncLruCache(Generic[KT, VT]):
"""

def __init__(self, *args, **kwargs): # type: ignore
self.lru_cache: LruCache[KT, VT] = LruCache(*args, **kwargs)
self._lru_cache: LruCache[KT, VT] = LruCache(*args, **kwargs)

async def get(
self, key: KT, default: Optional[T] = None, update_metrics: bool = True
) -> Optional[VT]:
return self.lru_cache.get(key, update_metrics=update_metrics)
return self._lru_cache.get(key, update_metrics=update_metrics)

async def set(self, key: KT, value: VT) -> None:
self.lru_cache.set(key, value)
self._lru_cache.set(key, value)

async def invalidate(self, key: KT) -> None:
return self.lru_cache.invalidate(key)
return self._lru_cache.invalidate(key)

def invalidate_local(self, key: KT) -> None:
return self.lru_cache.invalidate(key)
return self._lru_cache.invalidate(key)

async def contains(self, key: KT) -> bool:
return self.lru_cache.contains(key)
return self._lru_cache.contains(key)

def clear(self) -> None:
self.lru_cache.clear()
self._lru_cache.clear()

0 comments on commit f04a949

Please sign in to comment.