From: Guangrong Fu Date: Thu, 2 Dec 2021 01:52:52 +0000 (+0800) Subject: Added exception protection. X-Git-Tag: 10.0.0~4^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=holmes%2Fengine-management.git;a=commitdiff_plain;h=b91b7e660f94fc1cf23e8f778472eeaa493116df Added exception protection. Added try-catch block to prevent the polling thread from stop. Issue-ID: HOLMES-488 Signed-off-by: Guangrong Fu Change-Id: I459798651a684e85a2ac04265df99658399b13af --- diff --git a/engine-d/src/main/java/org/onap/holmes/engine/dcae/ConfigFileScanningTask.java b/engine-d/src/main/java/org/onap/holmes/engine/dcae/ConfigFileScanningTask.java index 2835a45..15cb327 100644 --- a/engine-d/src/main/java/org/onap/holmes/engine/dcae/ConfigFileScanningTask.java +++ b/engine-d/src/main/java/org/onap/holmes/engine/dcae/ConfigFileScanningTask.java @@ -59,15 +59,18 @@ public class ConfigFileScanningTask implements Runnable { DcaeConfigurations dcaeConfigurations = null; try { dcaeConfigurations = DcaeConfigurationParser.parse(entry.getValue().toString()); + if (dcaeConfigurations != null) { + DcaeConfigurationsCache.setDcaeConfigurations(dcaeConfigurations); + addSubscribers(dcaeConfigurations); + } } catch (CorrelationException e) { LOGGER.error(e.getMessage(), e); + // reset the value of the pre-md5 so that configs could be re-processed during the next scanning. + prevConfigMd5 = null; } catch (Exception e) { LOGGER.warn("Failed to deal with the new configurations.", e); - } - - if (dcaeConfigurations != null) { - DcaeConfigurationsCache.setDcaeConfigurations(dcaeConfigurations); - addSubscribers(dcaeConfigurations); + // reset the value of the pre-md5 so that configs could be re-processed during the next scanning. + prevConfigMd5 = null; } } }