Skip to content

Commit 52433a8

Browse files
kleshsstojak1Josip Stojak
authored
refactoring to use simple ApiCollector (#7609) (#7743)
Co-authored-by: sstojak1 <18380216+sstojak1@users.noreply.github.com> Co-authored-by: Josip Stojak <Josip.Stojak@infobip.com>
1 parent 5fa4200 commit 52433a8

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

backend/plugins/bitbucket_server/tasks/pr_collector.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,8 @@ var CollectApiPullRequestsMeta = plugin.SubTaskMeta{
3939

4040
func CollectApiPullRequests(taskCtx plugin.SubTaskContext) errors.Error {
4141
rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx, RAW_PULL_REQUEST_TABLE)
42-
collectorWithState, err := helper.NewStatefulApiCollector(*rawDataSubTaskArgs)
43-
if err != nil {
44-
return err
45-
}
4642

47-
err = collectorWithState.InitCollector(helper.ApiCollectorArgs{
43+
collector, err := helper.NewApiCollector(helper.ApiCollectorArgs{
4844
RawDataSubTaskArgs: *rawDataSubTaskArgs,
4945
ApiClient: data.ApiClient,
5046
PageSize: 100,
@@ -57,5 +53,5 @@ func CollectApiPullRequests(taskCtx plugin.SubTaskContext) errors.Error {
5753
return err
5854
}
5955

60-
return collectorWithState.Execute()
56+
return collector.Execute()
6157
}

0 commit comments

Comments
 (0)