(self, path: str, content: str)
| 33 | return content |
| 34 | |
| 35 | async def set(self, path: str, content: str) -> None: |
| 36 | abs_path = os.path.abspath(path) |
| 37 | async with self._lock: |
| 38 | if abs_path in self._cache: |
| 39 | self._cache.move_to_end(abs_path) |
| 40 | self._cache[abs_path] = content |
| 41 | else: |
| 42 | self._cache[abs_path] = content |
| 43 | while len(self._cache) > self._max_entries: |
| 44 | self._cache.popitem(last=False) |
| 45 | |
| 46 | async def invalidate(self, path: str) -> bool: |
| 47 | abs_path = os.path.abspath(path) |
no outgoing calls