mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-11 03:57:01 +00:00
Remove unnecessary GitHub API calls (#363)
The controller had the 2 extra and redundant calls to List Workflow Runs API. Ref #362
This commit is contained in:
@@ -211,8 +211,6 @@ func (c *Client) listRunners(ctx context.Context, enterprise, org, repo string,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) ListRepositoryWorkflowRuns(ctx context.Context, user string, repoName string) ([]*github.WorkflowRun, error) {
|
func (c *Client) ListRepositoryWorkflowRuns(ctx context.Context, user string, repoName string) ([]*github.WorkflowRun, error) {
|
||||||
c.Client.Actions.ListRepositoryWorkflowRuns(ctx, user, repoName, nil)
|
|
||||||
|
|
||||||
queued, err := c.listRepositoryWorkflowRuns(ctx, user, repoName, "queued")
|
queued, err := c.listRepositoryWorkflowRuns(ctx, user, repoName, "queued")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("listing queued workflow runs: %w", err)
|
return nil, fmt.Errorf("listing queued workflow runs: %w", err)
|
||||||
@@ -232,8 +230,6 @@ func (c *Client) ListRepositoryWorkflowRuns(ctx context.Context, user string, re
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) listRepositoryWorkflowRuns(ctx context.Context, user string, repoName, status string) ([]*github.WorkflowRun, error) {
|
func (c *Client) listRepositoryWorkflowRuns(ctx context.Context, user string, repoName, status string) ([]*github.WorkflowRun, error) {
|
||||||
c.Client.Actions.ListRepositoryWorkflowRuns(ctx, user, repoName, nil)
|
|
||||||
|
|
||||||
var workflowRuns []*github.WorkflowRun
|
var workflowRuns []*github.WorkflowRun
|
||||||
|
|
||||||
opts := github.ListWorkflowRunsOptions{
|
opts := github.ListWorkflowRunsOptions{
|
||||||
|
|||||||
Reference in New Issue
Block a user