优化价格同步
This commit is contained in:
@@ -36,8 +36,10 @@ def sync(city=None):
|
||||
# 加载库中均价数据
|
||||
community_summary_df = es206_client.scan_by_sql_to_data_frame("SELECT city, region, name, avg_price FROM community_summary")
|
||||
|
||||
with ThreadPoolExecutor(30) as pool:
|
||||
with ThreadPoolExecutor(50) as pool:
|
||||
def deal(index, item):
|
||||
if index % 1000 == 0:
|
||||
log.info("已处理" + str(index))
|
||||
curr_city = item['city']
|
||||
curr_region = item['region']
|
||||
curr_name = item['name']
|
||||
@@ -82,7 +84,7 @@ def sync(city=None):
|
||||
try:
|
||||
helpers.bulk(es206_client.elastic_client, actions)
|
||||
count += len(actions)
|
||||
print("更新:" + str(count))
|
||||
print("已更新:" + str(count))
|
||||
except Exception as e:
|
||||
print(e)
|
||||
actions.clear()
|
||||
|
||||
Reference in New Issue
Block a user