diff options
author | Guangrong Fu <fu.guangrong@zte.com.cn> | 2021-12-02 09:52:52 +0800 |
---|---|---|
committer | Guangrong Fu <fu.guangrong@zte.com.cn> | 2021-12-02 09:52:52 +0800 |
commit | b91b7e660f94fc1cf23e8f778472eeaa493116df (patch) | |
tree | bb0cd968145478c3899abe218f3ca8e895761f85 /engine-d/src/main/java | |
parent | 11af2e24c981b080c2df3ecbf9574dbef56c47dc (diff) |
Added exception protection.
Added try-catch block to prevent the polling thread from stop.
Issue-ID: HOLMES-488
Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
Change-Id: I459798651a684e85a2ac04265df99658399b13af
Diffstat (limited to 'engine-d/src/main/java')
-rw-r--r-- | engine-d/src/main/java/org/onap/holmes/engine/dcae/ConfigFileScanningTask.java | 13 |
1 files changed, 8 insertions, 5 deletions
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; } } } |