Skip to content

Commit 94699c0

Browse files
mbburchMB Burchggreer
authored
Remove debugging added for retries (#39)
Co-authored-by: MB Burch <[email protected]> Co-authored-by: Geoff Greer <[email protected]>
1 parent fd3ea8a commit 94699c0

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

pkg/connector/tickets.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,10 @@ func (ln *Linear) ListTicketSchemas(ctx context.Context, p *pagination.Token) ([
152152
if err != nil {
153153
return nil, "", nil, err
154154
}
155-
l := ctxzap.Extract(ctx)
156155

157156
teams, nextToken, _, rlData, err := ln.client.ListTeamWorkflowStates(ctx, linear.GetTeamsVars{TeamIDs: ln.ticketSchemaTeamIDs, After: bag.PageToken(), First: resourcePageSize})
158157
annotations.WithRateLimiting(rlData)
159158
if err != nil {
160-
l.Debug("teams failed", zap.Error(err), zap.Any("rlData", rlData))
161159
return nil, "", annotations, fmt.Errorf("baton-linear: failed to list teams: %w", err)
162160
}
163161

@@ -169,7 +167,6 @@ func (ln *Linear) ListTicketSchemas(ctx context.Context, p *pagination.Token) ([
169167
fields, _, _, rlData, err := ln.client.ListIssueFields(ctx)
170168
annotations.WithRateLimiting(rlData)
171169
if err != nil {
172-
l.Debug("fields failed", zap.Error(err), zap.Any("rlData", rlData))
173170
return nil, "", annotations, fmt.Errorf("baton-linear: failed to list issue fields: %w", err)
174171
}
175172

pkg/linear/client.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -975,20 +975,12 @@ func (c *Client) doRequest(ctx context.Context, body interface{}, res interface{
975975

976976
resp, err := c.httpClient.Do(req, doOptions...)
977977

978-
l := ctxzap.Extract(ctx)
979978
// Linear returns 400 when rate limited, so change it to a retryable error
980979
if err != nil && resp != nil && (resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusTooManyRequests) {
981-
l.Debug("rate limiting detected", zap.Int("status_code", resp.StatusCode))
982980
resp.StatusCode = http.StatusTooManyRequests
983981

984982
rlData.Status = v2.RateLimitDescription_STATUS_OVERLIMIT
985983
return resp, rlData, uhttp.WrapErrorsWithRateLimitInfo(codes.Unavailable, resp, err)
986984
}
987-
988-
if resp != nil {
989-
l.Debug("returning without rate limit wrapping", zap.Int("status_code", resp.StatusCode))
990-
} else {
991-
l.Debug("returning without rate limit wrapping", zap.String("status_code", "nil response"))
992-
}
993985
return resp, rlData, err
994986
}

0 commit comments

Comments
 (0)