MCPcopy
hub / github.com/apache/devlake / NewTaigaApiClient

Function NewTaigaApiClient

backend/plugins/taiga/tasks/api_client.go:27–49  ·  view source on GitHub ↗
(taskCtx plugin.TaskContext, connection *models.TaigaConnection)

Source from the content-addressed store, hash-verified

25)
26
27func NewTaigaApiClient(taskCtx plugin.TaskContext, connection *models.TaigaConnection) (*api.ApiAsyncClient, errors.Error) {
28 // create synchronize api client
29 apiClient, err := api.NewApiClientFromConnection(taskCtx.GetContext(), taskCtx, connection)
30 if err != nil {
31 return nil, err
32 }
33
34 // create rate limit calculator
35 rateLimiter := &api.ApiRateLimitCalculator{
36 UserRateLimitPerHour: connection.RateLimitPerHour,
37 }
38
39 asyncApiClient, err := api.CreateAsyncApiClient(
40 taskCtx,
41 apiClient,
42 rateLimiter,
43 )
44 if err != nil {
45 return nil, err
46 }
47
48 return asyncApiClient, nil
49}

Callers

nothing calls this directly

Calls 1

GetContextMethod · 0.65

Tested by

no test coverage detected