Skip to content

Commit

Permalink
Hotfix/4631 (#4690)
Browse files Browse the repository at this point in the history
* fix: decrease page size for github graphql job collector (#4682)

* fix: change pr collector detail input (#4687)

* fix: change pr collector detail input

* fix: for review
  • Loading branch information
likyh authored Mar 16, 2023
1 parent 153cb13 commit 9116441
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions backend/plugins/github/tasks/pr_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var CollectApiPullRequestsMeta = plugin.SubTaskMeta{
}

type SimpleGithubPr struct {
GithubId int64
Number int64
}

type SimpleGithubApiPr struct {
Expand Down Expand Up @@ -102,7 +102,7 @@ func CollectApiPullRequests(taskCtx plugin.SubTaskContext) errors.Error {
BuildInputIterator: func() (helper.Iterator, errors.Error) {
// select pull id from database
cursor, err := db.Cursor(
dal.Select("github_id"),
dal.Select("number"),
dal.From(&models.GithubPullRequest{}),
dal.Where(
"repo_id = ? AND connection_id = ? AND state != 'closed'",
Expand All @@ -115,7 +115,7 @@ func CollectApiPullRequests(taskCtx plugin.SubTaskContext) errors.Error {
return helper.NewDalCursorIterator(db, cursor, reflect.TypeOf(SimpleGithubPr{}))
},
FinalizableApiCollectorCommonArgs: helper.FinalizableApiCollectorCommonArgs{
UrlTemplate: "repos/{{ .Params.Name }}/pulls/{{ .Input.GithubId }}",
UrlTemplate: "repos/{{ .Params.Name }}/pulls/{{ .Input.Number }}",
ResponseParser: func(res *http.Response) ([]json.RawMessage, errors.Error) {
body, err := io.ReadAll(res.Body)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/github_graphql/tasks/job_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func CollectGraphqlJobs(taskCtx plugin.SubTaskContext) errors.Error {

err = collectorWithState.InitGraphQLCollector(helper.GraphqlCollectorArgs{
Input: iterator,
InputStep: 60,
InputStep: 20,
Incremental: incremental,
GraphqlClient: data.GraphqlClient,
BuildQuery: func(reqData *helper.GraphqlRequestData) (interface{}, map[string]interface{}, error) {
Expand Down

0 comments on commit 9116441

Please sign in to comment.