Skip to content

Commit

Permalink
Update app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sondregronas committed Jul 26, 2024
1 parent 2b4c66b commit 88d4dc0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions BookingSystem/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def debug_login() -> flask.Response:
return app


app = create_app()
_app = create_app()
# We need to create an app object for gunicorn to use with the routine tasks only running on the main thread, not the
# workers. But since gunicorn doesn't run on Windows we need to catch the exception and run the app normally
try:
Expand All @@ -144,7 +144,7 @@ class App(gunicorn.app.base.BaseApplication):
def __init__(self):
start_routine()
self.options = {}
self.application = app.wsgi_app
self.application = _app
super().__init__()

def load_config(self):
Expand All @@ -161,6 +161,7 @@ def load(self):
except Exception as e:
logger.error(e)
start_routine()
app = _app

if __name__ == '__main__':
app.run(host='0.0.0.0')

0 comments on commit 88d4dc0

Please sign in to comment.