main.py 723 B

1234567891011121314151617181920212223242526
  1. from app import generate_app
  2. app = generate_app()
  3. def main():
  4. # 定时任务
  5. # from lib.JobManage import JobManage
  6. # JobManage.run()
  7. # 监听mqtt消息服务
  8. from unit.VehicleStateMessageListener import VehicleStateMessageListener
  9. VehicleStateMessageListener.run_background(background_is=True)
  10. # 监听mqtt消息服务
  11. from unit.PotDataMessageListener import PotDataMessageListener
  12. PotDataMessageListener.run_background(background_is=True)
  13. # 给websocket发数据的
  14. # from factories.line_manage import LineManage
  15. # LineManage.run_background()
  16. # websocket服务/api服务
  17. app.run(address='0.0.0.0', port=5042, debug=True)
  18. if __name__ == '__main__':
  19. main()