|
@@ -9,13 +9,12 @@ if root_dir not in sys.path:
|
|
|
|
|
|
from multiprocessing import Process
|
|
|
from odps import ODPS
|
|
|
-from threading import Timer
|
|
|
import threading
|
|
|
from my_utils import RedisHelper, execute_sql_from_odps
|
|
|
from my_config import set_config
|
|
|
from log import Log
|
|
|
import json
|
|
|
-from datetime import datetime
|
|
|
+from datetime import datetime, timedelta
|
|
|
from queue import Queue
|
|
|
from tqdm import tqdm
|
|
|
import time
|
|
@@ -204,7 +203,7 @@ def main():
|
|
|
|
|
|
log_.info("上游数据就绪,count={},开始读取数据表".format(table_data_cnt))
|
|
|
# 2 读取数据表 处理特征
|
|
|
- previous_date_str = (datetime.strptime(date, "%Y%m%d") - datetime.timedelta(days=1)).strftime("%Y%m%d")
|
|
|
+ previous_date_str = (datetime.strptime(date, "%Y%m%d") - timedelta(days=1)).strftime("%Y%m%d")
|
|
|
video_list = get_sql(date, previous_date_str, project)
|
|
|
# 3 写入redis
|
|
|
records_process_for_list(video_list, process_and_store, max_size=50, num_workers=8)
|