aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap')
-rw-r--r--src/main/java/org/onap/nbi/ServiceRegisterRunner.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main/java/org/onap/nbi/ServiceRegisterRunner.java b/src/main/java/org/onap/nbi/ServiceRegisterRunner.java
index 8c10e56..ed10a65 100644
--- a/src/main/java/org/onap/nbi/ServiceRegisterRunner.java
+++ b/src/main/java/org/onap/nbi/ServiceRegisterRunner.java
@@ -121,7 +121,7 @@ public class ServiceRegisterRunner implements CommandLineRunner {
);
int attempt = 0;
- while (true) {
+ while (attempt<RETRY) {
attempt += 1;
try {
logger.info("Registration with msb discovery (attempt {}/{})", attempt, RETRY);
@@ -130,11 +130,8 @@ public class ServiceRegisterRunner implements CommandLineRunner {
logger.debug("Registration with msb discovery done, microServiceFullInfo = {}", microServiceFullInfo.toString());
break;
} catch (Exception ex) {
- if (attempt == RETRY) {
- throw new Exception("Registration with msb discovery FAILED");
- }
+ logger.info("Registration with msb discovery (attempt {}/{}) FAILED. Sleep {}ms", attempt, RETRY, RETRY_INTERVAL);
}
- logger.info("Registration with msb discovery (attempt {}/{}) FAILED. Sleep {}ms", attempt, RETRY, RETRY_INTERVAL);
Thread.sleep(RETRY_INTERVAL);
}
}