From 196c7eb494a2904b74b2736a5620709f6e3e9a89 Mon Sep 17 00:00:00 2001 From: vv181 Date: Fri, 14 Jul 2017 14:59:37 +0700 Subject: [PATCH] remove stream info cache remove stream info cache --- CHANGELOG.md | 5 +++-- lbrynet/daemon/Daemon.py | 20 -------------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e9a12630..eb8210cd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,8 +32,9 @@ at anytime. ### Fixed * Fixed timeout behaviour when calling API command get * Fixed https://github.com/lbryio/lbry/issues/765 - - + +### Removed + * Removed stream_info_cache.json from daemon.py ## [0.14.0] - 2017-07-05 diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index 87c94c7c5..9d4758b2a 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -209,7 +209,6 @@ class Daemon(AuthJSONRPCServer): self.query_handlers = {} self.waiting_on = {} self.streams = {} - self.name_cache = {} self.exchange_rate_manager = ExchangeRateManager() calls = { Checker.INTERNET_CONNECTION: LoopingCall(CheckInternetConnection(self)), @@ -246,7 +245,6 @@ class Daemon(AuthJSONRPCServer): yield self._initial_setup() yield threads.deferToThread(self._setup_data_directory) yield self._check_db_migration() - yield self._load_caches() yield self._get_session() yield self._get_analytics() yield add_lbry_file_to_sd_identifier(self.sd_identifier) @@ -270,18 +268,6 @@ class Daemon(AuthJSONRPCServer): d = _log_platform() return d - def _load_caches(self): - name_cache_filename = os.path.join(self.db_dir, "stream_info_cache.json") - - if os.path.isfile(name_cache_filename): - with open(name_cache_filename, "r") as name_cache_file: - name_cache = name_cache_file.read() - try: - self.name_cache = json.loads(name_cache) - log.info("Loaded claim info cache") - except ValueError: - log.warning("Unable to load claim info cache") - def _check_network_connection(self): self.connected_to_internet = utils.check_connection() @@ -673,12 +659,6 @@ class Daemon(AuthJSONRPCServer): dt = utils.utcnow() - utils.datetime_obj(year=2012, month=12, day=21) return int(dt.total_seconds()) - def _update_claim_cache(self): - f = open(os.path.join(self.db_dir, "stream_info_cache.json"), "w") - f.write(json.dumps(self.name_cache)) - f.close() - return defer.succeed(True) - @defer.inlineCallbacks def _resolve_name(self, name, force_refresh=False): """Resolves a name. Checks the cache first before going out to the blockchain.