Skip to content

Commit

Permalink
Use ListWorkflow instead of ScanWorkflow for batch operation (#2620)
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminc committed Mar 19, 2022
1 parent e2d6b31 commit 32410dc
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions service/worker/batcher/workflow.go
Expand Up @@ -266,10 +266,7 @@ func BatchActivity(ctx context.Context, batchParams BatchParams) (HeartBeatDetai
}

for {
// TODO https://github.com/uber/cadence/issues/2154
// Need to improve scan concurrency because it will hold an ES resource until the workflow finishes.
// And we can't use list API because terminate / reset will mutate the result.
resp, err := sdkClient.ScanWorkflow(ctx, &workflowservice.ScanWorkflowExecutionsRequest{
resp, err := sdkClient.ListWorkflow(ctx, &workflowservice.ListWorkflowExecutionsRequest{
PageSize: int32(pageSize),
NextPageToken: hbd.PageToken,
Query: batchParams.Query,
Expand Down

0 comments on commit 32410dc

Please sign in to comment.