uranusjr commented on code in PR #32759:
URL: https://github.com/apache/airflow/pull/32759#discussion_r1271628802
##########
airflow/www/app.py:
##########
@@ -81,7 +81,9 @@ def create_app(config=None, testing=False):
flask_app.secret_key = conf.get("webserver", "SECRET_KEY")
flask_app.config["PERMANENT_SESSION_LIFETIME"] =
timedelta(minutes=settings.get_session_lifetime_config())
- flask_app.config.from_pyfile(settings.WEBSERVER_CONFIG, silent=True)
+ # Enable customizations in webserver_config.py to be applied via
Flask.current_app.
Review Comment:
The import is basically free and does not change anything, but setting up
the app context is not. That might sound backwards but is how Flask works.
In this instance though, the heavy lifting has already been done before this
line, and I can’t think of things that you can do only when the context is
_not_ enabled, so a config doesn’t sound that useful to me.
##########
airflow/www/app.py:
##########
@@ -81,7 +81,9 @@ def create_app(config=None, testing=False):
flask_app.secret_key = conf.get("webserver", "SECRET_KEY")
flask_app.config["PERMANENT_SESSION_LIFETIME"] =
timedelta(minutes=settings.get_session_lifetime_config())
- flask_app.config.from_pyfile(settings.WEBSERVER_CONFIG, silent=True)
+ # Enable customizations in webserver_config.py to be applied via
Flask.current_app.
Review Comment:
The import is basically free and does not change anything, but setting up
the app context is not. That might sound backwards but is how Flask works.
In this instance though, the heavy lifting has already been done before this
line, and I can’t think of things that you can do only when the context is
_not_ enabled, so a config doesn’t sound that useful to me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]