aboutsummaryrefslogtreecommitdiffstats
path: root/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandExecutorImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandExecutorImpl.java')
-rw-r--r--appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandExecutorImpl.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandExecutorImpl.java b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandExecutorImpl.java
index 0948b2b4d..d9df1dd23 100644
--- a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandExecutorImpl.java
+++ b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandExecutorImpl.java
@@ -25,7 +25,8 @@
package org.openecomp.appc.executor.impl;
-import java.util.Date;
+import java.time.Instant;
+import java.time.temporal.ChronoUnit;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang.ObjectUtils;
@@ -107,9 +108,9 @@ public class CommandExecutorImpl implements CommandExecutor {
}
private long getRemainingTTL(RuntimeContext request) {
- Date requestTimestamp = request.getRequestContext().getCommonHeader().getTimeStamp();
+ Instant requestTimestamp = request.getRequestContext().getCommonHeader().getTimeStamp();
int ttl = request.getRequestContext().getCommonHeader().getFlags().getTtl();
- return ttl*1000 + requestTimestamp.getTime() - System.currentTimeMillis();
+ return ChronoUnit.MILLIS.between(Instant.now(), requestTimestamp.plusSeconds(ttl));
}
private CommandTask getMessageExecutor(String action){