Skip to content

Commit

Permalink
Switch parentclosepolicy worker to internal types (cadence-workflow#3807
Browse files Browse the repository at this point in the history
)
  • Loading branch information
vytautas-karpavicius authored Nov 30, 2020
1 parent bb71629 commit fb144ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion service/history/task/transfer_active_task_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,7 @@ func (t *transferActiveTaskExecutor) processParentClosePolicy(
executions = append(executions, parentclosepolicy.RequestDetail{
WorkflowID: childInfo.StartedWorkflowID,
RunID: childInfo.StartedRunID,
Policy: childInfo.ParentClosePolicy,
Policy: *thrift.ToParentClosePolicy(&childInfo.ParentClosePolicy),
})
}

Expand Down
9 changes: 4 additions & 5 deletions service/worker/parentclosepolicy/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"go.uber.org/cadence/activity"
"go.uber.org/cadence/workflow"

"github.com/uber/cadence/.gen/go/shared"
"github.com/uber/cadence/common"
"github.com/uber/cadence/common/log"
"github.com/uber/cadence/common/log/tag"
Expand All @@ -52,7 +51,7 @@ type (
RequestDetail struct {
WorkflowID string
RunID string
Policy shared.ParentClosePolicy
Policy types.ParentClosePolicy
}

// Request defines the request for parent close policy
Expand Down Expand Up @@ -106,10 +105,10 @@ func ProcessorActivity(ctx context.Context, request Request) error {
for _, execution := range request.Executions {
var err error
switch execution.Policy {
case shared.ParentClosePolicyAbandon:
case types.ParentClosePolicyAbandon:
//no-op
continue
case shared.ParentClosePolicyTerminate:
case types.ParentClosePolicyTerminate:
err = client.TerminateWorkflowExecution(nil, &types.HistoryTerminateWorkflowExecutionRequest{
DomainUUID: common.StringPtr(request.DomainUUID),
TerminateRequest: &types.TerminateWorkflowExecutionRequest{
Expand All @@ -122,7 +121,7 @@ func ProcessorActivity(ctx context.Context, request Request) error {
Identity: common.StringPtr(processorWFTypeName),
},
})
case shared.ParentClosePolicyRequestCancel:
case types.ParentClosePolicyRequestCancel:
err = client.RequestCancelWorkflowExecution(nil, &types.HistoryRequestCancelWorkflowExecutionRequest{
DomainUUID: common.StringPtr(request.DomainUUID),
CancelRequest: &types.RequestCancelWorkflowExecutionRequest{
Expand Down

0 comments on commit fb144ff

Please sign in to comment.