降低并行线程数

This commit is contained in:
shenjian@fangjia.com
2023-03-09 14:38:00 +08:00
parent 68e154d390
commit c9e802da90
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -144,7 +144,7 @@ def sync(city=None):
seaweed_df.loc[index, 'avg_cost'] = price
else:
seaweed_df.loc[index, 'avg_cost'] = None
with ThreadPoolExecutor(max_workers=30) as pool:
with ThreadPoolExecutor(max_workers=20) as pool:
for index, item in seaweed_df.iterrows():
pool.submit(find_around_price_item, index, item)
# for index, item in seaweed_df.iterrows():
@@ -110,7 +110,7 @@ def sync_by_city(city_now):
log.info(f"{city_now}开始补充物业费....")
sql = "select id, city, region, name, estate_charge, finish_building_date, location from community_summary where city='" + city_now + "' and (estate_charge is null or estate_charge_flag=1)"
community_summary_df = es206_client.scan_by_sql_to_data_frame(sql)
with ThreadPoolExecutor(max_workers=50) as pool:
with ThreadPoolExecutor(max_workers=20) as pool:
def deal(index, item):
if index % 1000 == 0 and index > 0:
log.info(f"已查找{index}")
@@ -78,7 +78,7 @@ def sync(city=None):
elif len(around_seaweed_df) == 1:
seaweed_df.loc[index, 'relative_price_ranking'] = 0.5
with ThreadPoolExecutor(max_workers=30) as pool:
with ThreadPoolExecutor(max_workers=20) as pool:
for index, item in seaweed_df.iterrows():
pool.submit(find_around_price_item, index, item)