修复BUG

This commit is contained in:
sjshenjian
2024-11-27 16:33:40 +08:00
parent 1cd5079ac4
commit db8cbf0edb
+4 -3
View File
@@ -11,7 +11,8 @@ from threading import Lock
mutex = Lock() mutex = Lock()
log = logging.getLogger(__name__) 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') tmp_ck = ClickHouseClient(database='tmp')
index_name = "community_summary" index_name = "community_summary"
@@ -143,12 +144,12 @@ def sync(city=None):
actions.append(action) actions.append(action)
if len(actions) == 5000: if len(actions) == 5000:
helpers.bulk(es206_client.elastic_client, actions) helpers.bulk(es89_client.elastic_client, actions)
count += len(actions) count += len(actions)
log.info("更新:" + str(count)) log.info("更新:" + str(count))
actions.clear() actions.clear()
if len(actions) > 0: if len(actions) > 0:
helpers.bulk(es206_client.elastic_client, actions) helpers.bulk(es89_client.elastic_client, actions)
actions.clear() actions.clear()
log.info("完成同步消费数据...") log.info("完成同步消费数据...")