forked from LBRYCommunity/lbry-sdk
be a writer by default
This commit is contained in:
parent
dfca15395e
commit
8d028adc53
2 changed files with 5 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue