Skip to content

Commit

Permalink
bump ttl in vfs TTLCache upon any access
Browse files Browse the repository at this point in the history
  • Loading branch information
azuline committed Feb 13, 2024
1 parent fb93d9e commit 8aab093
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rose/virtualfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def __getitem__(self, key: K) -> V:
v, insert_time = self.__backing[key]
if time.time() - insert_time > self.ttl_seconds:
raise KeyError(key)
self.__backing[key] = (v, time.time())
return v

def __setitem__(self, key: K, value: V) -> None:
Expand Down

0 comments on commit 8aab093

Please sign in to comment.