diff options
| author | 2019-06-22 23:30:15 +0100 | |
|---|---|---|
| committer | 2019-06-22 23:30:15 +0100 | |
| commit | 01bad3a76e97e5e7aec948bff382d23b39d32669 (patch) | |
| tree | 10cf7dff338d0e263288aece9d274684e1eef063 /src/Cache.py | |
| parent | colorise ref for `delete` event, same as for `create` event (diff) | |
| signature | ||
Don't needlessly call time.monotonic() when checking cache expirations
Diffstat (limited to 'src/Cache.py')
| -rw-r--r-- | src/Cache.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Cache.py b/src/Cache.py index 73e1fd4d..478aa027 100644 --- a/src/Cache.py +++ b/src/Cache.py @@ -20,7 +20,8 @@ class Cache(object): expirations = list(filter(None, expirations)) if not expirations: return None - expirations = [e-time.monotonic() for e in expirations] + now = time.monotonic() + expirations = [e-now for e in expirations] return max(min(expirations), 0) def expire(self): |
