def load_cached_storage(cache_file, default_size=1000):
if cache_file is not None and os.path.exists(cache_file):
print("Loading cache: {0}".format(cache_file))
with bz2.open(cache_file, "rb") as file:
try:
cache = pickle.load(file)
return cache
except pickle.PickleError and EOFError:
return None
return ThingCache(cache_size=default_size, file=cache_file)
评论列表
文章目录