Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Update start time in updateTask if it is unset (#3109)
Browse files Browse the repository at this point in the history
* Update start time in updateTask if it is unset

Update start time in updateTask if it is unset.

* Update ExecutionDAOFacade.java

* Fix the import
  • Loading branch information
jun-he authored Jul 15, 2022
1 parent 4f9c4d7 commit 816ef11
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
package com.netflix.conductor.core.orchestration;

import static com.netflix.conductor.common.metadata.tasks.Task.Status.IN_PROGRESS;
import static com.netflix.conductor.core.execution.WorkflowExecutor.DECIDER_QUEUE;

import com.fasterxml.jackson.core.JsonProcessingException;
Expand Down Expand Up @@ -361,7 +362,10 @@ public long getInProgressTaskCount(String taskDefName) {
*/
public void updateTask(Task task) {
try {
if (task.getStatus() != null) {
if (task.getStatus() != null) {
if (task.getStatus() == IN_PROGRESS && task.getStartTime() == 0) {
task.setStartTime(System.currentTimeMillis());
}
if (!task.getStatus().isTerminal() || (task.getStatus().isTerminal() && task.getUpdateTime() == 0)) {
task.setUpdateTime(System.currentTimeMillis());
}
Expand Down

0 comments on commit 816ef11

Please sign in to comment.