This is an automated email from the ASF dual-hosted git repository.

zhangliang2022 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new cc799029 fix: unexpected EOF and busy buffer (#2042)
cc799029 is described below

commit cc7990298596838bf24a0a625a5872be24e70d02
Author: abeizn <[email protected]>
AuthorDate: Tue May 31 18:06:22 2022 +0800

    fix: unexpected EOF and busy buffer (#2042)
    
    * fix: unexpected EOF and busy buffer
    
    * fix: unexpected EOF and busy buffer
---
 plugins/github/tasks/pr_commit_collector.go  | 2 +-
 plugins/github/tasks/pr_review_collector.go  | 2 +-
 plugins/gitlab/tasks/shared.go               | 3 ++-
 plugins/jenkins/tasks/build_collector.go     | 2 +-
 plugins/tapd/tasks/bug_commit_collector.go   | 2 +-
 plugins/tapd/tasks/story_commit_collector.go | 2 +-
 plugins/tapd/tasks/task_commit_collector.go  | 2 +-
 7 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/plugins/github/tasks/pr_commit_collector.go 
b/plugins/github/tasks/pr_commit_collector.go
index 527881f0..196284f3 100644
--- a/plugins/github/tasks/pr_commit_collector.go
+++ b/plugins/github/tasks/pr_commit_collector.go
@@ -52,7 +52,7 @@ func CollectApiPullRequestCommits(taskCtx 
core.SubTaskContext) error {
 
        incremental := false
 
-       cursor, err := db.Model(&models.GithubPullRequest{}).
+       cursor, err := db.Model(&models.GithubPullRequest{}).Select("number, 
github_id").
                Where("repo_id = ?", data.Repo.GithubId).
                Rows()
        if err != nil {
diff --git a/plugins/github/tasks/pr_review_collector.go 
b/plugins/github/tasks/pr_review_collector.go
index 3128dc45..b067970c 100644
--- a/plugins/github/tasks/pr_review_collector.go
+++ b/plugins/github/tasks/pr_review_collector.go
@@ -47,7 +47,7 @@ func CollectApiPullRequestReviews(taskCtx 
core.SubTaskContext) error {
 
        incremental := false
 
-       cursor, err := db.Model(&models.GithubPullRequest{}).
+       cursor, err := db.Model(&models.GithubPullRequest{}).Select("number, 
github_id").
                Where("repo_id = ?", data.Repo.GithubId).
                Rows()
        if err != nil {
diff --git a/plugins/gitlab/tasks/shared.go b/plugins/gitlab/tasks/shared.go
index 66292ee7..ae40ade5 100644
--- a/plugins/gitlab/tasks/shared.go
+++ b/plugins/gitlab/tasks/shared.go
@@ -96,7 +96,8 @@ func CreateRawDataSubTaskArgs(taskCtx core.SubTaskContext, 
Table string) (*helpe
 func GetMergeRequestsIterator(taskCtx core.SubTaskContext) 
(*helper.CursorIterator, error) {
        db := taskCtx.GetDb()
        data := taskCtx.GetData().(*GitlabTaskData)
-       cursor, err := db.Model(&models.GitlabMergeRequest{}).Where("project_id 
= ?", data.Options.ProjectId).Select("gitlab_id,iid").Rows()
+       cursor, err := 
db.Model(&models.GitlabMergeRequest{}).Select("gitlab_id, iid").
+       Where("project_id = ?", 
data.Options.ProjectId).Select("gitlab_id,iid").Rows()
        if err != nil {
                return nil, err
        }
diff --git a/plugins/jenkins/tasks/build_collector.go 
b/plugins/jenkins/tasks/build_collector.go
index ad860cd3..9a3339d2 100644
--- a/plugins/jenkins/tasks/build_collector.go
+++ b/plugins/jenkins/tasks/build_collector.go
@@ -45,7 +45,7 @@ type SimpleJob struct {
 func CollectApiBuilds(taskCtx core.SubTaskContext) error {
        db := taskCtx.GetDb()
        data := taskCtx.GetData().(*JenkinsTaskData)
-       cursor, err := db.Model(&models.JenkinsJob{}).Rows()
+       cursor, err := db.Model(&models.JenkinsJob{}).Select("name").Rows()
        if err != nil {
                return err
        }
diff --git a/plugins/tapd/tasks/bug_commit_collector.go 
b/plugins/tapd/tasks/bug_commit_collector.go
index 3e8d88bd..f4ffcf4c 100644
--- a/plugins/tapd/tasks/bug_commit_collector.go
+++ b/plugins/tapd/tasks/bug_commit_collector.go
@@ -62,7 +62,7 @@ func CollectBugCommits(taskCtx core.SubTaskContext) error {
        if since != nil {
                tx = tx.Where("modified > ? and connection_id = ? and 
workspace_id = ?", since, data.Options.ConnectionId, data.Options.WorkspaceID)
        }
-       cursor, err := tx.Rows()
+       cursor, err := tx.Select("id").Rows()
        if err != nil {
                return err
        }
diff --git a/plugins/tapd/tasks/story_commit_collector.go 
b/plugins/tapd/tasks/story_commit_collector.go
index 3e9d2d84..d8e6fc41 100644
--- a/plugins/tapd/tasks/story_commit_collector.go
+++ b/plugins/tapd/tasks/story_commit_collector.go
@@ -62,7 +62,7 @@ func CollectStoryCommits(taskCtx core.SubTaskContext) error {
        if since != nil {
                tx = tx.Where("modified > ? and connection_id = ? and 
workspace_id = ?", since, data.Options.ConnectionId, data.Options.WorkspaceID)
        }
-       cursor, err := tx.Rows()
+       cursor, err := tx.Select("id").Rows()
        if err != nil {
                return err
        }
diff --git a/plugins/tapd/tasks/task_commit_collector.go 
b/plugins/tapd/tasks/task_commit_collector.go
index 3bf0390b..09085dac 100644
--- a/plugins/tapd/tasks/task_commit_collector.go
+++ b/plugins/tapd/tasks/task_commit_collector.go
@@ -62,7 +62,7 @@ func CollectTaskCommits(taskCtx core.SubTaskContext) error {
        if since != nil {
                tx = tx.Where("modified > ? and connection_id = ? and 
workspace_id = ?", since, data.Options.ConnectionId, data.Options.WorkspaceID)
        }
-       cursor, err := tx.Rows()
+       cursor, err := tx.Select("id").Rows()
        if err != nil {
                return err
        }

Reply via email to