aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar jesopo2019-11-19 11:41:50 +0000
committerGravatar jesopo2019-11-19 11:41:50 +0000
commitbc6b1dda47b4076b7280c9729ff139a7cbac4ecb (patch)
treeef962ebf799f2495f8835e89bc4cc46ab9cfc77c /src
parentremove double space for youtube views (diff)
signature
chance src/Cache.py from time.monotonic() to time.time()
Diffstat (limited to 'src')
-rw-r--r--src/Cache.py8
1 files changed, 4 insertions, 4 deletions
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()