This is an automated email from the ASF dual-hosted git repository.
lynwee 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 208fa7f0a refactoring to use simple ApiCollector (#7609)
208fa7f0a is described below
commit 208fa7f0a74c74d499c0fcad1bd4540b92e856ee
Author: sstojak1 <[email protected]>
AuthorDate: Mon Jun 17 09:11:03 2024 +0200
refactoring to use simple ApiCollector (#7609)
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()
}