aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorromaingimbert <romain.gimbert@orange.com>2018-10-23 15:14:29 +0200
committerromaingimbert <romain.gimbert@orange.com>2018-10-23 15:14:29 +0200
commit4eecf9135e133a1a9a5f177fae3d0e7582d65190 (patch)
tree844c4cba8fe3916ff6f40fc2a33ada189e8e8574 /src/main
parent9c35f307e7019b702b600612bc8eaf6eafc214d3 (diff)
start up failed without msb
-fix code Change-Id: I17c5ca36dd4c3995addbef7061af17782d721890 Issue-ID: EXTAPI-164 Signed-off-by: romaingimbert <romain.gimbert@orange.com>
Diffstat (limited to 'src/main')
-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);
}
}