修复人均消费bug

This commit is contained in:
shenjian@fangjia.com
2022-11-24 18:13:18 +08:00
parent ec26e5836c
commit 2f434d279c
+5 -2
View File
@@ -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():