Adding VIM refresh period to RO charm config
[osm/devops.git] / installers / charm / osm-ro / src / charm.py
index 8b45191..c19281e 100755 (executable)
@@ -203,6 +203,12 @@ class OsmRoCharm(CharmBase):
         ]:
             raise CharmError("invalid value for log-level option")
 
+        refresh_period = self.config.get("period_refresh_active")
+        if refresh_period and refresh_period < 60 and refresh_period != -1:
+            raise ValueError(
+                "Refresh Period is too tight, insert >= 60 seconds or disable using -1"
+            )
+
     def _check_relations(self) -> None:
         """Validate charm relations.
 
@@ -290,6 +296,8 @@ class OsmRoCharm(CharmBase):
                         "OSMRO_STORAGE_PATH": "/app/storage",
                         "OSMRO_STORAGE_COLLECTION": "files",
                         "OSMRO_STORAGE_URI": self.mongodb_client.connection_string,
+                        "OSMRO_PERIOD_REFRESH_ACTIVE": self.config.get("period_refresh_active")
+                        or 60,
                     },
                 }
             },