Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions providers/fab/src/airflow/providers/fab/www/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from __future__ import annotations

from datetime import timedelta
from functools import cache
from os.path import isabs

from flask import Flask
Expand All @@ -44,8 +45,6 @@
from airflow.providers.fab.www.extensions.init_wsgi_middlewares import init_wsgi_middleware
from airflow.providers.fab.www.utils import get_session_lifetime_config

app: Flask | None = None

# Initializes at the module level, so plugins can access it.
# See: /docs/plugins.rst
csrf = CSRFProtect()
Expand Down Expand Up @@ -119,15 +118,12 @@ def create_app(enable_plugins: bool):
return flask_app


@cache
def cached_app():
"""Return cached instance of Airflow WWW app."""
global app
if not app:
app = create_app()
return app
return create_app()


def purge_cached_app():
"""Remove the cached version of the app in global state."""
global app
app = None
cached_app.cache_clear()
2 changes: 1 addition & 1 deletion providers/fab/www-hash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
48926a5d09f218deb70a461d36aecec7e883a2210dea809082c99dbf0bd8d77d
9a7fd1175fa3e57b636662428771b3c9586be5551fe96e8dc35afffd792229d1