uranusjr commented on code in PR #61483:
URL: https://github.com/apache/airflow/pull/61483#discussion_r2785865959


##########
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:
   I’d prefer to avoid using `conf` eagerly on import time. Maybe a `@cache`-ed 
function instead?



-- 
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]

Reply via email to