From 89c46eb87ff89a0c0ef9975fc8f5dd0c5d0cc95d Mon Sep 17 00:00:00 2001 From: Skip Wonnell Date: Thu, 14 Sep 2017 09:50:07 -0500 Subject: Update TTL calculation to use milliseconds Code used mix of seconds and milliseconds calculate TTL. Updated to use consistent units. Also added a new test file to increase code coverage. Issue-ID: APPC-207 Issue-ID: APPC-181 Change-Id: I07687ac30fa2e75cedb027ec2bb71f6914d42075 Signed-off-by: Skip Wonnell --- .../openecomp/appc/requesthandler/impl/AbstractRequestHandlerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'appc-dispatcher/appc-request-handler') diff --git a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/openecomp/appc/requesthandler/impl/AbstractRequestHandlerImpl.java b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/openecomp/appc/requesthandler/impl/AbstractRequestHandlerImpl.java index 7200c6ca1..c14b2c1e7 100644 --- a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/openecomp/appc/requesthandler/impl/AbstractRequestHandlerImpl.java +++ b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/openecomp/appc/requesthandler/impl/AbstractRequestHandlerImpl.java @@ -411,7 +411,7 @@ public abstract class AbstractRequestHandlerImpl implements RequestHandler { if (logger.isTraceEnabled()) { logger.trace("Entering to calculateRemainingTTL with RequestHeader = " + ObjectUtils.toString(commonHeader)); } - long usedTimeInMillis = (System.currentTimeMillis() - commonHeader.getTimeStamp().getEpochSecond()); + long usedTimeInMillis = (System.currentTimeMillis() - commonHeader.getTimeStamp().toEpochMilli()); logger.debug("usedTimeInMillis = " + usedTimeInMillis); int usedTimeInSeconds = Math.round(usedTimeInMillis / 1000); logger.debug("usedTimeInSeconds = " + usedTimeInSeconds); -- cgit 1.2.3-korg