remove stream info cache

remove stream info cache
This commit is contained in:
vv181 2017-07-14 14:59:37 +07:00
parent 2728b1ed60
commit 196c7eb494
2 changed files with 3 additions and 22 deletions

View file

@ -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

View file

@ -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.