dw_order_update_min.py 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. import logging
  2. import time
  3. from logging import handlers
  4. from app.etl.dw.dw_channel_daily import dw_channel
  5. from app.etl.sync_to_ck_task import order_sync_ck
  6. from model.DateUtils import DateUtils
  7. from app.api_data.platform_order.order_data_change import insert_order_data
  8. def order_update():
  9. logging.info('start update order')
  10. insert_order_data(du.getNow())
  11. order_sync_ck(du.getNow())
  12. dw_channel()
  13. logging.info('end update order')
  14. du = DateUtils()
  15. if __name__ == '__main__':
  16. logging.basicConfig(
  17. handlers=[
  18. logging.handlers.RotatingFileHandler('./log/dw_order_update_min.log',
  19. maxBytes=10 * 1024 * 1024,
  20. backupCount=5,
  21. encoding='utf-8')
  22. , logging.StreamHandler() # 供输出使用
  23. ],
  24. level=logging.INFO,
  25. format="%(asctime)s - %(levelname)s %(filename)s %(funcName)s %(lineno)s - %(message)s"
  26. )
  27. order_update()