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

abeizn pushed a commit to branch release-v1.0
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/release-v1.0 by this push:
     new 52433a8bc refactoring to use simple ApiCollector (#7609) (#7743)
52433a8bc is described below

commit 52433a8bc098eba668a02d815d618409aa375b93
Author: Klesh Wong <[email protected]>
AuthorDate: Tue Jul 16 16:45:28 2024 +0800

    refactoring to use simple ApiCollector (#7609) (#7743)
    
    Co-authored-by: sstojak1 <[email protected]>
    Co-authored-by: Josip Stojak <[email protected]>
---
 backend/plugins/bitbucket_server/tasks/pr_collector.go | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/backend/plugins/bitbucket_server/tasks/pr_collector.go 
b/backend/plugins/bitbucket_server/tasks/pr_collector.go
index 3a72ec8ba..d94442588 100644
--- a/backend/plugins/bitbucket_server/tasks/pr_collector.go
+++ b/backend/plugins/bitbucket_server/tasks/pr_collector.go
@@ -39,12 +39,8 @@ var CollectApiPullRequestsMeta = plugin.SubTaskMeta{
 
 func CollectApiPullRequests(taskCtx plugin.SubTaskContext) errors.Error {
        rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx, 
RAW_PULL_REQUEST_TABLE)
-       collectorWithState, err := 
helper.NewStatefulApiCollector(*rawDataSubTaskArgs)
-       if err != nil {
-               return err
-       }
 
-       err = collectorWithState.InitCollector(helper.ApiCollectorArgs{
+       collector, err := helper.NewApiCollector(helper.ApiCollectorArgs{
                RawDataSubTaskArgs:    *rawDataSubTaskArgs,
                ApiClient:             data.ApiClient,
                PageSize:              100,
@@ -57,5 +53,5 @@ func CollectApiPullRequests(taskCtx plugin.SubTaskContext) 
errors.Error {
                return err
        }
 
-       return collectorWithState.Execute()
+       return collector.Execute()
 }

Reply via email to