Skip to content

Commit

Permalink
[Wf-Diagnostics] update tasklist type in request to DescribeTaskList (c…
Browse files Browse the repository at this point in the history
  • Loading branch information
sankari165 authored Aug 30, 2024
1 parent 4b76e5b commit 3f1f3a6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions service/worker/diagnostics/invariants/timeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func (t *timeout) RootCause(ctx context.Context, issues []InvariantCheckResult)

func (t *timeout) checkTasklist(ctx context.Context, issue InvariantCheckResult) (InvariantRootCauseResult, error) {
var taskList *types.TaskList
var tasklistType *types.TaskListType
switch issue.InvariantType {
case TimeoutTypeExecution.String():
var metadata ExecutionTimeoutMetadata
Expand All @@ -139,22 +140,25 @@ func (t *timeout) checkTasklist(ctx context.Context, issue InvariantCheckResult)
return InvariantRootCauseResult{}, err
}
taskList = metadata.Tasklist
tasklistType = types.TaskListTypeDecision.Ptr()
case TimeoutTypeActivity.String():
var metadata ActivityTimeoutMetadata
err := json.Unmarshal(issue.Metadata, &metadata)
if err != nil {
return InvariantRootCauseResult{}, err
}
taskList = metadata.Tasklist
tasklistType = types.TaskListTypeActivity.Ptr()
}
if taskList == nil {
return InvariantRootCauseResult{}, fmt.Errorf("tasklist not set")
}

frontendClient := t.clientBean.GetFrontendClient()
resp, err := frontendClient.DescribeTaskList(ctx, &types.DescribeTaskListRequest{
Domain: t.domain,
TaskList: taskList,
Domain: t.domain,
TaskList: taskList,
TaskListType: tasklistType,
})
if err != nil {
return InvariantRootCauseResult{}, err
Expand Down

0 comments on commit 3f1f3a6

Please sign in to comment.