Skip to content

Commit

Permalink
simply change
Browse files Browse the repository at this point in the history
  • Loading branch information
shijiesheng committed Jan 16, 2025
1 parent 5f75c34 commit f17dce3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
4 changes: 2 additions & 2 deletions internal/internal_poller_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ func (m *pollerUsageEstimator) CollectUsage(data interface{}) error {
func isTaskEmpty(task interface{}) (bool, error) {
switch t := task.(type) {
case *workflowTask:
return t == nil || isEmptyDecisionTask(t.task), nil
return t == nil || t.task == nil || len(t.task.TaskToken) == 0, nil
case *activityTask:
return t == nil || isEmptyActivityTask(t.task), nil
return t == nil || t.task == nil || len(t.task.TaskToken) == 0, nil
case *localActivityTask:
return t == nil || t.workflowTask == nil, nil
default:
Expand Down
8 changes: 0 additions & 8 deletions internal/internal_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,3 @@ func getLengthOfStringPointer(s *string) int {
}
return len(*s)
}

func isEmptyDecisionTask(r *s.PollForDecisionTaskResponse) bool {
return r == nil || len(r.TaskToken) == 0
}

func isEmptyActivityTask(r *s.PollForActivityTaskResponse) bool {
return r == nil || len(r.TaskToken) == 0
}

0 comments on commit f17dce3

Please sign in to comment.