Skip to content

Commit

Permalink
Do not generate workflow timeout task if workflow is closed (temporal…
Browse files Browse the repository at this point in the history
  • Loading branch information
wxing1292 authored and samanbarghi committed May 2, 2023
1 parent b5afc76 commit b488c47
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions service/history/workflow/task_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,14 @@ func (r *TaskGeneratorImpl) GenerateWorkflowStartTasks(
return nil
}

r.mutableState.AddTasks(&tasks.WorkflowTimeoutTask{
// TaskID is set by shard
WorkflowKey: r.mutableState.GetWorkflowKey(),
VisibilityTimestamp: workflowRunExpirationTime,
Version: startVersion,
})

if r.mutableState.IsWorkflowExecutionRunning() {
r.mutableState.AddTasks(&tasks.WorkflowTimeoutTask{
// TaskID is set by shard
WorkflowKey: r.mutableState.GetWorkflowKey(),
VisibilityTimestamp: workflowRunExpirationTime,
Version: startVersion,
})
}
return nil
}

Expand Down

0 comments on commit b488c47

Please sign in to comment.