def _save(self): ''' @summary: 現在のメモリキャッシュでキャッシュファイルを更新します ''' try: for key, cache in self.cache.iteritems(): dump(cache, build_path(self.cache_dir, key)) except Exception: # pickle error raise
def _store_cache_file(self, key, val, expiration_date): ''' @summary: ファイル上のキャッシュにキーと値を格納します ''' try: if isinstance(val, unicode): val = val.encode(self.default_encoding) dump(_CacheData(val=val, expiration_date=expiration_date), build_path(self.cache_dir, key)) except Exception: raise