This is an automated email from the ASF dual-hosted git repository.
lynwee pushed a commit to branch dev-1
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/dev-1 by this push:
new 9ec020c7c feat(circleci): restranformate without api client
9ec020c7c is described below
commit 9ec020c7c821f7bde701425bd3d5409e796d7d27
Author: d4x1 <[email protected]>
AuthorDate: Mon Sep 9 23:35:03 2024 +0800
feat(circleci): restranformate without api client
---
backend/plugins/circleci/impl/impl.go | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/backend/plugins/circleci/impl/impl.go
b/backend/plugins/circleci/impl/impl.go
index d9a1bd865..8e052711a 100644
--- a/backend/plugins/circleci/impl/impl.go
+++ b/backend/plugins/circleci/impl/impl.go
@@ -110,9 +110,14 @@ func (p Circleci) PrepareTaskData(taskCtx
plugin.TaskContext, options map[string
return nil, errors.Default.Wrap(err, "unable to get Circleci
connection by the given connection ID")
}
- apiClient, err := tasks.NewCircleciApiClient(taskCtx, connection)
- if err != nil {
- return nil, errors.Default.Wrap(err, "unable to get Circleci
API client instance")
+ var apiClient *helper.ApiAsyncClient
+ syncPolicy := taskCtx.SyncPolicy()
+ if !syncPolicy.SkipCollectors {
+ newApiClient, err := tasks.NewCircleciApiClient(taskCtx,
connection)
+ if err != nil {
+ return nil, errors.Default.Wrap(err, "unable to get
Circleci API client instance")
+ }
+ apiClient = newApiClient
}
project := &models.CircleciProject{}
err = taskCtx.GetDal().First(project, dal.Where("slug = ?",
op.ProjectSlug))