Files
PriceSystem/PriceSystem/fangjia/cachedObjectWrapper.py
T
2018-03-26 18:06:06 +08:00

12 lines
318 B
Python

import time
class CachedObjectWrapper:
def __init__(self, val, timestamp, cached_time=None):
self.val = val
self.timestamp = timestamp
self.cached_time = cached_time
def is_expire(self):
return self.cached_time is not None and time.time() > self.cached_time + self.timestamp