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': '', 'INDIVIDUAL_TAG_INDEXES': '',
'RPC_PORT': self.rpc_port, 'RPC_PORT': self.rpc_port,
'ES_INDEX_PREFIX': uuid4().hex, 'ES_INDEX_PREFIX': uuid4().hex,
'ES_MODE': 'writer',
} }
if extraconf: if extraconf:
conf.update(extraconf) conf.update(extraconf)

View file

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