aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ri/src
diff options
context:
space:
mode:
authorPriyank Maheshwari <priyank.maheshwari@est.tech>2024-03-29 10:22:51 +0000
committerGerrit Code Review <gerrit@onap.org>2024-03-29 10:22:51 +0000
commit33d583f85521eda86648a5fd4baeaa403c88c5e3 (patch)
tree8f60c88a48738b6b8bbcb3bc58b5e7a32f245a1e /cps-ri/src
parent3cf768abb67e9d53ee0fe8c9b0b8efc3dfdbb60e (diff)
parentea7d1b448699d890d15fd37c69d4705a094a1b53 (diff)
Merge "Uplift Spring boot 3.2.4"
Diffstat (limited to 'cps-ri/src')
-rwxr-xr-xcps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java
index b0f9a2da52..17f13b81ad 100755
--- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java
+++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java
@@ -69,6 +69,7 @@ import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException;
import org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangModelDependencyInfo;
import org.springframework.dao.DataIntegrityViolationException;
+import org.springframework.retry.RetryContext;
import org.springframework.retry.annotation.Backoff;
import org.springframework.retry.annotation.Retryable;
import org.springframework.retry.support.RetrySynchronizationManager;
@@ -277,8 +278,8 @@ public class CpsModulePersistenceServiceImpl implements CpsModulePersistenceServ
dataIntegrityViolationException, newYangResourceEntities);
convertedException.ifPresent(
e -> {
- int retryCount = RetrySynchronizationManager.getContext() == null ? 0
- : RetrySynchronizationManager.getContext().getRetryCount();
+ final RetryContext retryContext = RetrySynchronizationManager.getContext();
+ int retryCount = retryContext == null ? 0 : retryContext.getRetryCount();
log.warn("Cannot persist duplicated yang resource. System will attempt this method "
+ "up to 5 times. Current retry count : {}", ++retryCount, e);
});