@@ -14,18 +14,20 @@ def __init__(
1414 url : str ,
1515 log : Logger | None = None ,
1616 cache_size : int = 10 ,
17- cache_lifetime : int = 3600 ,
17+ cache_lifetime_s : int = 3600 ,
1818 ) -> None :
1919 """
2020 Initialize the ConfigServer client.
2121
2222 Args:
2323 url: Base URL of the config server.
2424 log: Optional logger instance.
25+ cache_size: Size of the cache (maximum number of items can be stored).
26+ cache_lifetime: Lifetime of the cache (in seconds).
2527 """
2628 self ._url = url .rstrip ("/" )
2729 self ._log = log if log else getLogger ("daq_config_server.client" )
28- self ._cache = TTLCache (maxsize = cache_size , ttl = cache_lifetime )
30+ self ._cache = TTLCache (maxsize = cache_size , ttl = cache_lifetime_s )
2931
3032 def _get (
3133 self ,
@@ -34,13 +36,11 @@ def _get(
3436 reset_cached_result : bool = False ,
3537 ) -> Any :
3638 """
37- Internal method to get data from the cache config server, with cache
38- management.
39- This method checks if the data is already cached. If it is, it returns
40- the cached data. If not, it fetches the data from the config server,
41- caches it, and returns the data.
42- If reset_cached_result is True, it will remove the cached data and
43- fetch it again from the config server.
39+ Get data from the config server with cache management.
40+ If a cached response doesn't already exist, makes a request to
41+ the config server.
42+ If reset_cached_result is true, remove the cache entry for that request and
43+ make a new request
4444
4545 Args:
4646 endpoint: API endpoint.
0 commit comments