Skip to content

Commit

Permalink
Updated workflow sweeper
Browse files Browse the repository at this point in the history
Updated workflow sweeper to use the workflowOffsetTimeout rather than the task timeout when the task is in progress.
  • Loading branch information
danmiller192 committed Oct 21, 2024
1 parent 91651d4 commit 6f8f421
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,7 @@ void unack(WorkflowModel workflowModel, long workflowOffsetTimeout) {
} else if (taskModel.getTaskType().equals(TaskType.TASK_TYPE_HUMAN)) {
postponeDurationSeconds = workflowOffsetTimeout;
} else {
postponeDurationSeconds =
(taskModel.getResponseTimeoutSeconds() != 0)
? taskModel.getResponseTimeoutSeconds() + 1
: workflowOffsetTimeout;
postponeDurationSeconds = workflowOffsetTimeout;
}
break;
} else if (taskModel.getStatus() == Status.SCHEDULED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ public void testPostponeDurationForTaskInProgressWithResponseTimeoutSet() {
workflowSweeper.unack(workflowModel, defaultPostPoneOffSetSeconds);
verify(queueDAO)
.setUnackTimeout(
DECIDER_QUEUE, workflowModel.getWorkflowId(), (responseTimeout + 1) * 1000);
DECIDER_QUEUE,
workflowModel.getWorkflowId(),
defaultPostPoneOffSetSeconds * 1000);
}

@Test
Expand Down

0 comments on commit 6f8f421

Please sign in to comment.