Watchdog Process-Make Configurable 55/129155/10
authorDylanB95EST <dylan.byrne@est.tech>
Fri, 6 May 2022 09:43:58 +0000 (10:43 +0100)
committerDylanB95EST <dylan.byrne@est.tech>
Tue, 10 May 2022 14:38:28 +0000 (15:38 +0100)
Make time configurable for the watchdog process.
Add documentation outlining this.

Issue-ID: CPS-875
Change-Id: I1307c82d02789097efda1ba981eb1fd36c9efc38
Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
cps-application/src/main/resources/application.yml
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdog.java
docs/deployment.rst

index 138f4e1..00424a5 100644 (file)
@@ -137,3 +137,6 @@ ncmp:
             password: ${DMI_PASSWORD}\r
         api:\r
             base-path: dmi\r
+    timers:\r
+        advised-modules-sync:\r
+            sleep-time-ms: 30000
\ No newline at end of file
index 6941317..0d8f852 100644 (file)
@@ -38,7 +38,7 @@ public class ModuleSyncWatchdog {
     /**
      * Execute Cm Handle poll which changes the cm handle state from 'ADVISED' to 'READY'.
      */
-    @Scheduled(fixedDelay = 30000)
+    @Scheduled(fixedDelayString = "${ncmp.timers.advised-modules-sync.sleep-time-ms}")
     public void executeAdvisedCmHandlePoll() {
         YangModelCmHandle newAdvisedCmHandle = syncUtils.getAnAdvisedCmHandle();
         while (newAdvisedCmHandle != null) {
index 06e1ddc..7dd4494 100644 (file)
@@ -157,8 +157,10 @@ To get a listing of the cps-core Pods, run the following command:
   dev-cps-core-postgres-primary-f7766d46c-s9d5b         1/1     Running            0          24h
   dev-cps-core-postgres-replica-84659d68f9-6qnt4        1/1     Running            0          24h
 
+.. note::
+    The CPS Service will have to be restarted each time a change is made to a configurable property.
 
-Additional Cps-Core Customizations
+Additional CPS-Core Customizations
 ==================================
 
 The following table lists some properties that can be specified as Helm chart
@@ -181,14 +183,6 @@ Any spring supported property can be configured by providing in ``config.additio
 |                                       |                                                                                                         |                               |
 |                                       | See also :ref:`cps_common_credentials_retrieval`.                                                       |                               |
 +---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+
-| config.dmiPluginUserName              | User name used by cps-core to authenticate themselves for using ncmp-dmi-plugin service.                | ``dmiuser``                   |
-+---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+
-| config.dmiPluginUserPassword          | Internal password used by cps-core to connect to ncmp-dmi-plugin service.                               | Not defined                   |
-|                                       |                                                                                                         |                               |
-|                                       | If not defined, the password is generated when deploying the application.                               |                               |
-|                                       |                                                                                                         |                               |
-|                                       | See also :ref:`cps_common_credentials_retrieval`.                                                       |                               |
-+---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+
 | postgres.config.pgUserName            | Internal user name used by cps-core to connect to its own database.                                     | ``cps``                       |
 +---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+
 | postgres.config.pgUserPassword        | Internal password used by cps-core to connect to its own database.                                      | Not defined                   |
@@ -287,6 +281,22 @@ Any spring supported property can be configured by providing in ``config.additio
 | maximumPoolSize                       | including both idle and in-use connections.                                                             |                               |
 +---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+
 
+Additional CPS-NCMP Customizations
+==================================
++---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+
+| config.dmiPluginUserName              | User name used by cps-core to authenticate themselves for using ncmp-dmi-plugin service.                | ``dmiuser``                   |
++---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+
+| config.dmiPluginUserPassword          | Internal password used by cps-core to connect to ncmp-dmi-plugin service.                               | Not defined                   |
+|                                       |                                                                                                         |                               |
+|                                       | If not defined, the password is generated when deploying the application.                               |                               |
+|                                       |                                                                                                         |                               |
+|                                       | See also :ref:`cps_common_credentials_retrieval`.                                                       |                               |
++---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+
+| config.timers.advised-modules-sync    | Specifies the delay in milliseconds in which the module sync watch dog will wake again after finishing. | ``30000``                     |
+| .sleep-time-ms                        |                                                                                                         |                               |
+|                                       |                                                                                                         |                               |
++---------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------+
+
 CPS-Core Docker Installation
 ============================