Skip to content

Commit

Permalink
fix: fixing workflow counter
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0elliot committed Aug 9, 2023
1 parent 9383ab7 commit 7c4a7de
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -5790,7 +5790,7 @@ func UpdateAppAuth(ctx context.Context, auth AppAuthenticationStorage, workflowI
}

auth.Usage = append(auth.Usage, usageItem)
auth.WorkflowCount += 1
// auth.WorkflowCount += 1
auth.NodeCount += 1
updateAuth = true
} else if !nodeFound && add {
Expand All @@ -5809,6 +5809,16 @@ func UpdateAppAuth(ctx context.Context, auth AppAuthenticationStorage, workflowI
}
}

// go through auth.Usage and compile unique list of workflow_ids
var workflowIds []string
for _, usage := range auth.Usage {
if !ArrayContains(workflowIds, usage.WorkflowId) {
workflowIds = append(workflowIds, usage.WorkflowId)
}
}

auth.WorkflowCount = len(workflowIds)

return nil
}

Expand Down

0 comments on commit 7c4a7de

Please sign in to comment.