From e08e4d3c712a04339489677484bd0e62003bb35f Mon Sep 17 00:00:00 2001 From: mike <219478+ilude@users.noreply.github.com> Date: Mon, 1 Apr 2024 11:48:03 -0400 Subject: [PATCH] fix lxml issue on old hardware --- app/app.py | 24 +++++++++++------------- requirements.txt | 3 +-- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/app/app.py b/app/app.py index 4442f3f..c449802 100644 --- a/app/app.py +++ b/app/app.py @@ -111,16 +111,14 @@ async def widget(widget_name): if __name__ == '__main__': port = int(os.environ.get("ONBOARD_PORT", 9830)) debug = bool(os.environ.get("FLASK_DEBUG", "False")) - print(f"Running on port {port} with debug={debug}") - app.run(port=port, debug=debug) - # if debug: - # app.run(port=port, debug=debug) - # else: - # from hypercorn.config import Config - # from hypercorn.asyncio import serve - # config = Config() - # config.accesslog="-" - # config.errorlog="-" - # config.loglevel="DEBUG" - # config.bind = f"0.0.0.0:{port}" - # print(asyncio.run(serve(app, config))) + if debug: + app.run(port=port, debug=debug) + else: + from hypercorn.config import Config + from hypercorn.asyncio import serve + config = Config() + config.accesslog="-" + config.errorlog="-" + config.loglevel="DEBUG" + config.bind = f"0.0.0.0:{port}" + print(asyncio.run(serve(app, config))) diff --git a/requirements.txt b/requirements.txt index 7735e96..e80c92d 100755 --- a/requirements.txt +++ b/requirements.txt @@ -9,8 +9,7 @@ flask-caching hypercorn==0.15.0 langchain langchain-community -lxml +lxml==5.1.1 python-dotenv pyyaml requests -yamlpath