import threading from app.api_data.tx_ad_cost.get_cost_older import old_cost_hourly, old_cost_daily from app.etl.sync_to_ck_task import order_sync_ck from app.api_data.tx_ad_cost import get_cost_older from app.etl.data_stat_run import do_cost from app.api_data.platform_order.order_data_change import insert_order_data_daily, insert_order_data_hourly from model.DateUtils import DateUtils from app.game_data_sum.data_sum import change_data_style_daily, change_data_style_hourly du = DateUtils() def hourly(): t10 = threading.Thread(target=change_data_style_hourly) t11 = threading.Thread(target=old_cost_hourly) # t12 = threading.Thread(target=insert_order_data_hourly) t10.start() t10.join() t11.start() t11.join() # t12.start() # t12.join() def daily(): t10 = threading.Thread(target=change_data_style_daily) t11 = threading.Thread(target=old_cost_daily, args=()) # t12 = threading.Thread(target=insert_order_data_daily) t10.start() t10.join() t11.start() t11.join() # t12.start() # t12.join() def cost_yestoday_repair(): dt = du.get_n_days(-1) get_cost_older.run(dt, dt) do_cost(dt, dt) if __name__ == '__main__': import logging from logging import handlers logging.basicConfig( handlers=[ logging.handlers.RotatingFileHandler('task.log', maxBytes=10 * 1024 * 1024, backupCount=5, encoding='utf-8') , logging.StreamHandler() # 供输出使用 ], level=logging.INFO, format="%(asctime)s - %(levelname)s %(filename)s %(funcName)s %(lineno)s - %(message)s" ) # hourly() # cost_yestoday_repair() daily()