vincbeck commented on code in PR #63184:
URL: https://github.com/apache/airflow/pull/63184#discussion_r2905688329
##########
providers/keycloak/src/airflow/providers/keycloak/auth_manager/keycloak_auth_manager.py:
##########
@@ -81,6 +82,69 @@
log = logging.getLogger(__name__)
+_CACHE_TTL_SECONDS = 30
+_DEDUP_TIMEOUT_SECONDS = 60
+
+_filter_cache: dict[tuple, tuple[float, frozenset[str]]] = {}
+_filter_pending: dict[tuple, threading.Event] = {}
+_cache_lock = threading.Lock()
+
+
+def _cache_get(key: tuple) -> frozenset[str] | None:
Review Comment:
Could move all these cache related functions/constants into a separate file?
##########
providers/keycloak/src/airflow/providers/keycloak/auth_manager/keycloak_auth_manager.py:
##########
@@ -81,6 +82,69 @@
log = logging.getLogger(__name__)
+_CACHE_TTL_SECONDS = 30
+_DEDUP_TIMEOUT_SECONDS = 60
+
+_filter_cache: dict[tuple, tuple[float, frozenset[str]]] = {}
+_filter_pending: dict[tuple, threading.Event] = {}
+_cache_lock = threading.Lock()
+
+
+def _cache_get(key: tuple) -> frozenset[str] | None:
Review Comment:
Could we move all these cache related functions/constants into a separate
file?
--
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]