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:
If you prefer we can yes. There was a cached function originally in this PR
and we can go back to that.
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.
But it doesn't cost much to put it under a fn
--
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]