From: Guillaume Abrioux Date: Tue, 10 Feb 2026 15:15:42 +0000 (+0100) Subject: node-proxy: make the update loop interval configurable X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7ff447040541a16bacdf61da87dfd191ecace646;p=ceph.git node-proxy: make the update loop interval configurable Read system.refresh_interval from config and use it in the update loop sleep. The default value is 180s when unset. Fixes: https://tracker.ceph.com/issues/74749 Signed-off-by: Guillaume Abrioux --- diff --git a/src/ceph-node-proxy/ceph_node_proxy/baseredfishsystem.py b/src/ceph-node-proxy/ceph_node_proxy/baseredfishsystem.py index e91e589ef25..7b0ea9186e3 100644 --- a/src/ceph-node-proxy/ceph_node_proxy/baseredfishsystem.py +++ b/src/ceph-node-proxy/ceph_node_proxy/baseredfishsystem.py @@ -11,7 +11,7 @@ from ceph_node_proxy.redfish import ( update_component, ) from ceph_node_proxy.redfish_client import RedFishClient -from ceph_node_proxy.util import get_logger, normalize_dict, to_snake_case +from ceph_node_proxy.util import DEFAULTS, get_logger, normalize_dict, to_snake_case class BaseRedfishSystem(BaseSystem): @@ -105,6 +105,10 @@ class BaseRedfishSystem(BaseSystem): if hasattr(self, func): f = getattr(self, func) self.update_funcs.append(f) + config = kw.get("config") or {} + self.refresh_interval: int = config.get("system", {}).get( + "refresh_interval", DEFAULTS["system"]["refresh_interval"] + ) def update( self, @@ -150,7 +154,7 @@ class BaseRedfishSystem(BaseSystem): ) self.client.logout() raise - sleep(5) + sleep(self.refresh_interval) self.log.debug("lock released in the update loop.") self.log.debug("exiting update loop.") raise SystemExit(0) diff --git a/src/ceph-node-proxy/ceph_node_proxy/util.py b/src/ceph-node-proxy/ceph_node_proxy/util.py index 419bf18dbae..4d842a7bc93 100644 --- a/src/ceph-node-proxy/ceph_node_proxy/util.py +++ b/src/ceph-node-proxy/ceph_node_proxy/util.py @@ -19,7 +19,7 @@ DEFAULTS: Dict[str, Any] = { "endpoint": "https://%(mgr_host):%(mgr_port)/node-proxy/data", }, "system": { - "refresh_interval": 5, + "refresh_interval": 20, "vendor": "generic", }, "api": {