Create the app outside of the global context of app.py to avoid any interference

This commit is contained in:
2025-01-21 11:26:42 +01:00
parent 1b823b158b
commit a6ab53efa7
3 changed files with 34 additions and 18 deletions

View File

@@ -96,6 +96,6 @@ def setup_app(app: Flask) -> None:
g.version = __version__
# Make sure all connections are closed at the end
@app.teardown_appcontext
def close_connections(exception, /) -> None:
@app.teardown_request
def teardown_request(_: BaseException | None) -> None:
close()