多线程问题排查
This commit is contained in:
@@ -85,6 +85,7 @@ def find_around_price_item(seaweed_df, index, item):
|
||||
print(index)
|
||||
if pd.notna(price):
|
||||
seaweed_df.loc[index, 'avg_cost'] = int(price)
|
||||
print("success")
|
||||
else:
|
||||
seaweed_df.loc[index, 'avg_cost'] = None
|
||||
if item['_id'] == '50bd172ae4b0fbe60a6fe628':
|
||||
@@ -117,6 +118,7 @@ def sync(city=None):
|
||||
seaweed_df = seaweed_df[seaweed_df['city'] == city].copy()
|
||||
seaweed_df = seaweed_df.reset_index(drop=True)
|
||||
|
||||
i
|
||||
with ThreadPoolExecutor(max_workers=30) as pool:
|
||||
for index, item in seaweed_df.iterrows():
|
||||
pool.submit(find_around_price_item, seaweed_df, index, item)
|
||||
|
||||
Reference in New Issue
Block a user