降低并行线程数
This commit is contained in:
@@ -144,7 +144,7 @@ def sync(city=None):
|
|||||||
seaweed_df.loc[index, 'avg_cost'] = price
|
seaweed_df.loc[index, 'avg_cost'] = price
|
||||||
else:
|
else:
|
||||||
seaweed_df.loc[index, 'avg_cost'] = None
|
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():
|
for index, item in seaweed_df.iterrows():
|
||||||
pool.submit(find_around_price_item, index, item)
|
pool.submit(find_around_price_item, index, item)
|
||||||
# for index, item in seaweed_df.iterrows():
|
# for index, item in seaweed_df.iterrows():
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ def sync_by_city(city_now):
|
|||||||
log.info(f"{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)"
|
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)
|
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):
|
def deal(index, item):
|
||||||
if index % 1000 == 0 and index > 0:
|
if index % 1000 == 0 and index > 0:
|
||||||
log.info(f"已查找{index}")
|
log.info(f"已查找{index}")
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ def sync(city=None):
|
|||||||
elif len(around_seaweed_df) == 1:
|
elif len(around_seaweed_df) == 1:
|
||||||
seaweed_df.loc[index, 'relative_price_ranking'] = 0.5
|
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():
|
for index, item in seaweed_df.iterrows():
|
||||||
pool.submit(find_around_price_item, index, item)
|
pool.submit(find_around_price_item, index, item)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user