diff options
Diffstat (limited to 'src/Cache.py')
| -rw-r--r-- | src/Cache.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Cache.py b/src/Cache.py index 09c0230f..f28a0952 100644 --- a/src/Cache.py +++ b/src/Cache.py @@ -1,6 +1,7 @@ import hashlib, time, typing, uuid +from src import PollHook -class Cache(object): +class Cache(PollHook.PollHook): def __init__(self): self._items = {} @@ -21,7 +22,7 @@ class Cache(object): self._items[id] = [key, value, expiration] return id - def next_expiration(self) -> typing.Optional[float]: + def next(self) -> typing.Optional[float]: if not self._cached_expiration == None: return self._cached_expiration @@ -36,7 +37,7 @@ class Cache(object): self._cached_expiration = expiration return expiration - def expire(self): + def call(self): now = time.monotonic() expired = [] for id in self._items.keys(): |
