12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- 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
- du = DateUtils()
- def hourly():
- t11 = threading.Thread(target=old_cost_hourly)
- t12 = threading.Thread(target=insert_order_data_hourly)
- t11.start()
- t11.join()
- t12.start()
- t12.join()
- def daily():
- t11 = threading.Thread(target=old_cost_daily, args=())
- t12 = threading.Thread(target=insert_order_data_daily())
- 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__':
- hourly()
- # cost_yestoday_repair()
|