Fix bug where PM-Mapper waits 1s after sending every request 79/114279/2 1.4.2
authorRemigiusz Janeczek <remigiusz.janeczek@nokia.com>
Tue, 27 Oct 2020 15:54:42 +0000 (16:54 +0100)
committerRemigiusz Janeczek <remigiusz.janeczek@nokia.com>
Tue, 27 Oct 2020 16:33:53 +0000 (17:33 +0100)
Issue-ID: DCAEGEN2-2500
Signed-off-by: Remigiusz Janeczek <remigiusz.janeczek@nokia.com>
Change-Id: I441172ed0d2957ef58c2ba40718ec79328c48da2

pom.xml
src/main/java/org/onap/dcaegen2/services/pmmapper/utils/RequestSender.java
version.properties

diff --git a/pom.xml b/pom.xml
index 60504ed..878b6c8 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -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>
index 9938eed..4993a10 100644 (file)
@@ -100,6 +100,9 @@ public class RequestSender {
         int attempts = 1;\r
         try {\r
             while (!status && attempts <= MAX_RETRIES) {\r
+                if(attempts != 1) {\r
+                    Thread.sleep(RETRY_INTERVAL);\r
+                }\r
                 final URL url = new URL(urlString);\r
                 final HttpURLConnection connection = getHttpURLConnection(method, url, invocationID, requestID);\r
 \r
@@ -117,7 +120,6 @@ public class RequestSender {
                 result = getResult(attempts, connection);\r
                 status = !isWithinErrorRange(connection.getResponseCode());\r
                 attempts++;\r
-                Thread.sleep(RETRY_INTERVAL);\r
             }\r
         } catch (IOException | NoSuchAlgorithmException ex) {\r
             logger.unwrap().warn("Request failure", ex);\r
@@ -173,4 +175,4 @@ public class RequestSender {
         }\r
         return result;\r
     }\r
-}
\ No newline at end of file
+}\r
index f352992..6494452 100644 (file)
@@ -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