|
@@ -7,6 +7,7 @@ import json
|
|
|
import argparse
|
|
|
|
|
|
from tqdm import tqdm
|
|
|
+from concurrent.futures.thread import ThreadPoolExecutor
|
|
|
|
|
|
sys.path.append(os.getcwd())
|
|
|
|
|
@@ -85,11 +86,13 @@ class DataProcessor(object):
|
|
|
select_sql = "SELECT video_id, hour_dt_str FROM lightgbm_data;"
|
|
|
init_data_tuple = self.client_spider.select(select_sql)
|
|
|
init_list = list(init_data_tuple)
|
|
|
- for item in tqdm(init_list):
|
|
|
- try:
|
|
|
- process_info(item)
|
|
|
- except Exception as e:
|
|
|
- print("操作失败", e)
|
|
|
+ with ThreadPoolExecutor(max_workers=10) as Pool:
|
|
|
+ Pool.map(process_info, init_list)
|
|
|
+ # for item in tqdm(init_list):
|
|
|
+ # try:
|
|
|
+ # process_info(item)
|
|
|
+ # except Exception as e:
|
|
|
+ # print("操作失败", e)
|
|
|
|
|
|
def update_user_info(self, start_date, end_date):
|
|
|
"""
|