be a writer by default

This commit is contained in:
Victor Shyba 2021-02-09 19:05:23 -03:00
parent dfca15395e
commit 8d028adc53
2 changed files with 5 additions and 4 deletions

View file

@ -190,6 +190,7 @@ class SPVNode:
'INDIVIDUAL_TAG_INDEXES': '',
'RPC_PORT': self.rpc_port,
'ES_INDEX_PREFIX': uuid4().hex,
'ES_MODE': 'writer',
}
if extraconf:
conf.update(extraconf)

View file

@ -951,7 +951,10 @@ class LBRYLevelDB(LevelDB):
for algorithm_name in self.env.trending_algorithms:
if algorithm_name in TRENDING_ALGORITHMS:
trending.append(TRENDING_ALGORITHMS[algorithm_name])
if self.env.es_mode == 'writer':
if self.env.es_mode == 'reader':
self.logger.info('Index mode: reader')
self.sql = None
else:
self.logger.info('Index mode: writer. Using SQLite db to sync ES')
self.sql = SQLDB(
self, path,
@ -959,9 +962,6 @@ class LBRYLevelDB(LevelDB):
self.env.default('FILTERING_CHANNEL_IDS', '').split(' '),
trending
)
else:
self.logger.info('Index mode: reader')
self.sql = None
# Search index
self.search_index = SearchIndex(self.env.es_index_prefix)