From 2f434d279ce64ef6ffcadf6ab7e91ce0e4ab6793 Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Thu, 24 Nov 2022 18:13:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=BA=E5=9D=87=E6=B6=88?= =?UTF-8?q?=E8=B4=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/business/business/community/avg_cost.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dags/business/business/community/avg_cost.py b/dags/business/business/community/avg_cost.py index 3253335..52ff07e 100644 --- a/dags/business/business/community/avg_cost.py +++ b/dags/business/business/community/avg_cost.py @@ -110,6 +110,8 @@ def sync(city=None): seaweed_df = seaweed_df.reset_index(drop=True) def find_around_price_item(index, item): + if index % 1000 == 0: + log.info("已查找" + str(index)) if 'lng' not in item: return lng = commutils.format_lat_lng(item['lng']) @@ -117,10 +119,11 @@ def sync(city=None): price = find_around_price(lng, lat) seaweed_df.loc[index, 'avg_cost'] = price - with ThreadPoolExecutor(max_workers=50) as pool: + with ThreadPoolExecutor(max_workers=30) as pool: for index, item in seaweed_df.iterrows(): pool.submit(find_around_price_item, index, item) - + # for index, item in seaweed_df.iterrows(): + # find_around_price_item(index, item) actions = list() count = 0 for index, item in seaweed_df.iterrows():