# from app import generate_app # app = generate_app() import traceback from app import generate_app # import uvicorn app = generate_app() def main(): try: # 定时任务 from lib.JobManage import JobManage JobManage.run() # 监听mqtt消息服务 from lib.MessageListener import MessageListener MessageListener.run(background_is=True) # 给websocket发数据的 # from factories.line_manage import LineManage # LineManage.run_background() # websocket服务 与 api服务 app.run(address='0.0.0.0', port=5042, debug=True) except Exception as exception: print(f'main23: {exception.__class__.__name__}', flush=True) print(f'main23: {traceback.format_exc()}', flush=True) if __name__ == '__main__': main()