]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
node-proxy: make the update loop interval configurable
authorGuillaume Abrioux <gabrioux@ibm.com>
Tue, 10 Feb 2026 15:15:42 +0000 (16:15 +0100)
committerGuillaume Abrioux <gabrioux@ibm.com>
Thu, 19 Feb 2026 12:54:56 +0000 (12:54 +0000)
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 <gabrioux@ibm.com>
(cherry picked from commit 7ff447040541a16bacdf61da87dfd191ecace646)

src/ceph-node-proxy/ceph_node_proxy/baseredfishsystem.py
src/ceph-node-proxy/ceph_node_proxy/util.py

index e91e589ef25418a156feeeb55a8c039887d20ea1..7b0ea9186e3e9d7850388970cdea7b684c522e20 100644 (file)
@@ -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)
index 419bf18dbae6e2603875f611247e07c1eafb3481..4d842a7bc93cda0ed28462b5ca7bbc8f9a98e8a9 100644 (file)
@@ -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": {