Skip to content

Commit

Permalink
[AIRFLOW-5417] Fix DB disconnects during webserver startup (apache#6023)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinYang21 authored Sep 10, 2019
1 parent 6b02bb3 commit 205db4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion airflow/www/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ def create_app(config=None, session=None, testing=False, app_name="Airflow"):
configure_manifest_files(app)

with app.app_context():

from airflow.www.security import AirflowSecurityManager
security_manager_class = app.config.get('SECURITY_MANAGER_CLASS') or \
AirflowSecurityManager
Expand All @@ -108,6 +107,9 @@ def create_app(config=None, session=None, testing=False, app_name="Airflow"):

def init_views(appbuilder):
from airflow.www import views
# Remove the session from scoped_session registry to avoid
# reusing a session with a disconnected connection
appbuilder.session.remove()
appbuilder.add_view_no_menu(views.Airflow())
appbuilder.add_view_no_menu(views.DagModelView())
appbuilder.add_view_no_menu(views.ConfigurationView())
Expand Down

0 comments on commit 205db4b

Please sign in to comment.