From bc6b1dda47b4076b7280c9729ff139a7cbac4ecb Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 19 Nov 2019 11:41:50 +0000 Subject: chance src/Cache.py from time.monotonic() to time.time() --- src/Cache.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Cache.py b/src/Cache.py index f28a0952..97e09268 100644 --- a/src/Cache.py +++ b/src/Cache.py @@ -14,7 +14,7 @@ class Cache(PollHook.PollHook): return self._cache(key, value, None) def temporary_cache(self, key: str, value: typing.Any, timeout: float )-> str: - return self._cache(key, value, time.monotonic()+timeout) + return self._cache(key, value, time.time()+timeout) def _cache(self, key: str, value: typing.Any, expiration: typing.Optional[float]) -> str: id = self.cache_key(key) @@ -30,7 +30,7 @@ class Cache(PollHook.PollHook): expirations = list(filter(None, expirations)) if not expirations: return None - now = time.monotonic() + now = time.time() expirations = [e-now for e in expirations] expiration = max(min(expirations), 0) @@ -38,7 +38,7 @@ class Cache(PollHook.PollHook): return expiration def call(self): - now = time.monotonic() + now = time.time() expired = [] for id in self._items.keys(): key, value, expiration = self._items[id] @@ -63,4 +63,4 @@ class Cache(PollHook.PollHook): return expiration def until_expiration(self, key: typing.Any) -> float: expiration = self.get_expiration(key) - return expiration-time.monotonic() + return expiration-time.time() -- cgit v1.3.1-10-gc9f91