get mem cache :param mem_cache: MemCache attribute('c'/'i'/'f'). :param key: cache key. :return: cache value; if cache not exist, return None.
(mem_cache, key)
| 192 | |
| 193 | @staticmethod |
| 194 | def get_cache(mem_cache, key): |
| 195 | """get mem cache |
| 196 | |
| 197 | :param mem_cache: MemCache attribute('c'/'i'/'f'). |
| 198 | :param key: cache key. |
| 199 | :return: cache value; if cache not exist, return None. |
| 200 | """ |
| 201 | value = None |
| 202 | expire = False |
| 203 | if key in mem_cache: |
| 204 | value, latest_time = mem_cache[key] |
| 205 | expire = (time.time() - latest_time) > MemCacheExpire.CACHE_EXPIRE |
| 206 | return value, expire |
| 207 | |
| 208 | |
| 209 | class CacheUtils: |