re_run_aba_2022.py 1.1 KB
Newer Older
chenyuanjie committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
import os
import sys

sys.path.append(os.path.dirname(sys.path[0]))
from utils.DolphinschedulerHelper import DolphinschedulerHelper
from utils.common_util import CommonUtil


if __name__ == '__main__':
    date_list = ['2022-02', '2022-03', '2022-04', '2022-05', '2022-06',
                 '2022-07', '2022-08', '2022-09', '2022-10', '2022-11', '2022-12']
    for date_info in date_list:
        print(f"当前执行的分区为:{date_info}")
        success_flag = DolphinschedulerHelper.start_and_watch_process_instance(
            "big_data_selection",
            process_df_name='ABA品牌标签调整重跑_api',
            startParams={
                "site_name": "us",
                "date_type": "month",
                "date_info": date_info,
                "wx_user": "chenyuanjie"
            }
        )
        if success_flag:
            continue
        else:
            CommonUtil.send_wx_msg(["chenyuanjie"], f"ABA品牌标签调整重跑_api {date_info} 执行失败")
            break

    CommonUtil.send_wx_msg(["chenyuanjie"], "ABA品牌标签调整重跑_api 2022年 执行结束")

    pass