summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/onap/dcaegen2/services/pmmapper/utils/RequestSender.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/RequestSender.java b/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/RequestSender.java
index 9938eed..4993a10 100644
--- a/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/RequestSender.java
+++ b/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/RequestSender.java
@@ -100,6 +100,9 @@ public class RequestSender {
int attempts = 1;
try {
while (!status && attempts <= MAX_RETRIES) {
+ if(attempts != 1) {
+ Thread.sleep(RETRY_INTERVAL);
+ }
final URL url = new URL(urlString);
final HttpURLConnection connection = getHttpURLConnection(method, url, invocationID, requestID);
@@ -117,7 +120,6 @@ public class RequestSender {
result = getResult(attempts, connection);
status = !isWithinErrorRange(connection.getResponseCode());
attempts++;
- Thread.sleep(RETRY_INTERVAL);
}
} catch (IOException | NoSuchAlgorithmException ex) {
logger.unwrap().warn("Request failure", ex);
@@ -173,4 +175,4 @@ public class RequestSender {
}
return result;
}
-} \ No newline at end of file
+}