File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import logging
22import os
3- from functools import lru_cache , wraps
43import threading
4+ from functools import lru_cache , wraps
55
66from azure .monitor .opentelemetry import configure_azure_monitor
77
1010from ._constants import ENV_VAR_ENABLE_APP_INSIGHTS , ENV_VAR_ENGINE_ROOM_APP_ID
1111from .globalsettings import environment
1212
13-
1413_configure_lock = threading .Lock ()
1514_configured_loggers = {}
1615
16+
1717def _ensure_azure_monitor_configured (connection_string , logger_name ):
1818 cache_key = (connection_string , logger_name )
19-
19+
2020 if cache_key not in _configured_loggers :
2121 with _configure_lock :
2222 # Double-check locking
2323 if cache_key not in _configured_loggers :
24- configure_azure_monitor (connection_string = connection_string , logger_name = logger_name )
24+ configure_azure_monitor (
25+ connection_string = connection_string , logger_name = logger_name
26+ )
2527 _configured_loggers [cache_key ] = True
2628
2729
You can’t perform that action at this time.
0 commit comments