Skip to content

Commit

Permalink
task -> wft
Browse files Browse the repository at this point in the history
  • Loading branch information
ShahabT committed Nov 26, 2024
1 parent 401f501 commit 8f53c29
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions service/history/workflow/workflow_task_state_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1081,16 +1081,16 @@ func (m *workflowTaskStateMachine) afterAddWorkflowTaskCompletedEvent(
m.ms.executionInfo.LastCompletedWorkflowTaskStartedEventId = attrs.GetStartedEventId()
m.ms.executionInfo.MostRecentWorkerVersionStamp = attrs.GetWorkerVersion()

taskDeployment := attrs.GetDeployment()
taskBehavior := attrs.GetVersioningBehavior()
wftDeployment := attrs.GetDeployment()
wftBehavior := attrs.GetVersioningBehavior()
versioningInfo := m.ms.GetExecutionInfo().GetVersioningInfo()

var completedTransition bool
if versioningInfo.DeploymentTransition != nil {
// It's possible that the completed WFT is not yet from the current transition because when
// the transition started, the current wft was already started. In this case, we allow the
// started wft to run and when completed, we create another wft immediately.
if versioningInfo.DeploymentTransition.GetDeployment().Equal(taskDeployment) {
if versioningInfo.DeploymentTransition.GetDeployment().Equal(wftDeployment) {
versioningInfo.DeploymentTransition = nil
completedTransition = true
}
Expand All @@ -1111,13 +1111,13 @@ func (m *workflowTaskStateMachine) afterAddWorkflowTaskCompletedEvent(
wfBehaviorBefore := m.ms.GetEffectiveVersioningBehavior()

// Change deployment and behavior based on the completed wft.
if wfBehaviorBefore != taskBehavior || !wfDeploymentBefore.Equal(taskDeployment) {
if wfBehaviorBefore != wftBehavior || !wfDeploymentBefore.Equal(wftDeployment) {
if versioningInfo == nil {
versioningInfo = &workflowpb.WorkflowExecutionVersioningInfo{}
m.ms.GetExecutionInfo().VersioningInfo = versioningInfo
}
versioningInfo.Behavior = taskBehavior
versioningInfo.Deployment = taskDeployment
versioningInfo.Behavior = wftBehavior
versioningInfo.Deployment = wftDeployment
}

// Deployment and behavior after applying the data came from the completed wft.
Expand Down

0 comments on commit 8f53c29

Please sign in to comment.