修复人均消费bug
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user