Skip to content

Commit

Permalink
fix lxml issue on old hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
ilude committed Apr 1, 2024
1 parent 93eece6 commit e08e4d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
24 changes: 11 additions & 13 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ flask-caching
hypercorn==0.15.0
langchain
langchain-community
lxml
lxml==5.1.1
python-dotenv
pyyaml
requests
yamlpath

0 comments on commit e08e4d3

Please sign in to comment.