降低线程数

This commit is contained in:
shenjian@fangjia.com
2022-12-06 15:41:24 +08:00
parent 1596f647aa
commit 9020d31887
+4 -4
View File
@@ -29,12 +29,12 @@ def build_doc(item):
def sync(city=None):
log.info(f"开始同步出售信息至206 {index_name}")
seaweed_query = {'cat': 'district', 'status': 0}
if pd.notna(city):
seaweed_query['city'] = city
seaweed_df = pd.read_csv(path + '/seaweed.csv', sep='@', encoding='UTF-8')
if pd.notna(city):
seaweed_df = seaweed_df[seaweed_df['city'] == city].copy()
seaweed_df = seaweed_df.reset_index(drop=True)
with ThreadPoolExecutor(50) as pool:
with ThreadPoolExecutor(30) as pool:
def deal(index, item):
if index % 1000 == 0:
log.info("已处理" + str(index))