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': '',
|
'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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue