pierrejeambrun commented on code in PR #61483:
URL: https://github.com/apache/airflow/pull/61483#discussion_r2793830691
##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/dags.py:
##########
@@ -41,6 +41,14 @@
if TYPE_CHECKING:
from airflow.serialization.definitions.param import SerializedParamsDict
+
+# Module-level serializer instance for file tokens.
+# This avoids creating a new serializer and calling conf.get_mandatory_value()
+# for every DAG when generating file tokens, which significantly improves
+# performance of the /ui/dags endpoint.
+_FILE_TOKEN_SERIALIZER: URLSafeSerializer =
URLSafeSerializer(conf.get_mandatory_value("api", "secret_key"))
Review Comment:
There was a cached function originally in this PR.
I figured it's not needed because there are a lot of places where default
parameters for functions are computed from config, and that's done at module
level too.
Lets go back to your original idea @john-rodriguez-mgni with the cached
function so it's safer.
--
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]