diff --git a/iwf-idl b/iwf-idl index 651a3dd0..ea8e882a 160000 --- a/iwf-idl +++ b/iwf-idl @@ -1 +1 @@ -Subproject commit 651a3dd0f157bd5a9e4f7a78bed66218a071ef8d +Subproject commit ea8e882af5cb0a5ced9fd5374ce1696a3d9e6b87 diff --git a/src/main/java/io/iworkflow/core/command/TimerCommand.java b/src/main/java/io/iworkflow/core/command/TimerCommand.java index 15d55e0e..2eb8333a 100644 --- a/src/main/java/io/iworkflow/core/command/TimerCommand.java +++ b/src/main/java/io/iworkflow/core/command/TimerCommand.java @@ -7,18 +7,18 @@ @Value.Immutable public abstract class TimerCommand implements BaseCommand { - public abstract int getFiringUnixTimestampSeconds(); + public abstract long getDurationSeconds(); public static TimerCommand createByDuration(String commandId, Duration duration) { return ImmutableTimerCommand.builder() .commandId(commandId) - .firingUnixTimestampSeconds((int) (System.currentTimeMillis() / 1000 + duration.getSeconds())) + .durationSeconds(duration.getSeconds()) .build(); } public static TimerCommand createByDuration(Duration duration) { return ImmutableTimerCommand.builder() - .firingUnixTimestampSeconds((int) (System.currentTimeMillis() / 1000 + duration.getSeconds())) + .durationSeconds(duration.getSeconds()) .build(); } } \ No newline at end of file diff --git a/src/main/java/io/iworkflow/core/mapper/TimerCommandMapper.java b/src/main/java/io/iworkflow/core/mapper/TimerCommandMapper.java index 833a3ff6..dfaad86f 100644 --- a/src/main/java/io/iworkflow/core/mapper/TimerCommandMapper.java +++ b/src/main/java/io/iworkflow/core/mapper/TimerCommandMapper.java @@ -5,7 +5,7 @@ public class TimerCommandMapper { public static TimerCommand toGenerated(io.iworkflow.core.command.TimerCommand timerCommand) { final TimerCommand command = new TimerCommand() - .firingUnixTimestampSeconds((long) timerCommand.getFiringUnixTimestampSeconds()); + .durationSeconds(timerCommand.getDurationSeconds()); if (timerCommand.getCommandId().isPresent()) { command.commandId(timerCommand.getCommandId().get()); }