diff options
author | Remigiusz Janeczek <remigiusz.janeczek@nokia.com> | 2020-10-27 16:54:42 +0100 |
---|---|---|
committer | Remigiusz Janeczek <remigiusz.janeczek@nokia.com> | 2020-10-27 17:33:53 +0100 |
commit | 2fce394080972fea5545079e9ac2d7440629bddf (patch) | |
tree | 58299b8c6c186dfbddde0b495627d5b5f675bebd | |
parent | 40184d7894127cea0096e35c06424cf849d5578d (diff) |
Fix bug where PM-Mapper waits 1s after sending every request1.4.2
Issue-ID: DCAEGEN2-2500
Signed-off-by: Remigiusz Janeczek <remigiusz.janeczek@nokia.com>
Change-Id: I441172ed0d2957ef58c2ba40718ec79328c48da2
-rw-r--r-- | pom.xml | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dcaegen2/services/pmmapper/utils/RequestSender.java | 6 | ||||
-rw-r--r-- | version.properties | 2 |
3 files changed, 6 insertions, 4 deletions
@@ -26,7 +26,7 @@ <groupId>org.onap.dcaegen2.services</groupId> <artifactId>pm-mapper</artifactId> - <version>1.4.1-SNAPSHOT</version> + <version>1.4.2-SNAPSHOT</version> <parent> <groupId>org.onap.oparent</groupId> 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 +}
diff --git a/version.properties b/version.properties index f352992..6494452 100644 --- a/version.properties +++ b/version.properties @@ -1,6 +1,6 @@ major=1 minor=4 -patch=1 +patch=2 base_version=${major}.${minor}.${patch} release_version=${base_version} snapshot_version=${base_version}-SNAPSHOT |