修复BUG
This commit is contained in:
@@ -11,7 +11,8 @@ from threading import Lock
|
||||
|
||||
mutex = Lock()
|
||||
log = logging.getLogger(__name__)
|
||||
es206_client = ElasticSearchClient(host='192.168.0.89', username='elastic', password='elasticsearch')
|
||||
es206_client = ElasticSearchClient(host='192.168.0.206')
|
||||
es89_client = ElasticSearchClient(host='192.168.0.89', username='elastic', password='elasticsearch')
|
||||
tmp_ck = ClickHouseClient(database='tmp')
|
||||
|
||||
index_name = "community_summary"
|
||||
@@ -143,12 +144,12 @@ def sync(city=None):
|
||||
|
||||
actions.append(action)
|
||||
if len(actions) == 5000:
|
||||
helpers.bulk(es206_client.elastic_client, actions)
|
||||
helpers.bulk(es89_client.elastic_client, actions)
|
||||
count += len(actions)
|
||||
log.info("更新:" + str(count))
|
||||
actions.clear()
|
||||
if len(actions) > 0:
|
||||
helpers.bulk(es206_client.elastic_client, actions)
|
||||
helpers.bulk(es89_client.elastic_client, actions)
|
||||
actions.clear()
|
||||
|
||||
log.info("完成同步消费数据...")
|
||||
|
||||
Reference in New Issue
Block a user