Skip to content

Commit e4547af

Browse files
authored
Add retry on HTTP 429 (#274)
Co-authored-by: Serge Smertin <[email protected]>
1 parent a1b8fd9 commit e4547af

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

common/http.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@ func (c *DatabricksClient) checkHTTPRetry(ctx context.Context, resp *http.Respon
207207
// In this case don't retry and return the original error from httpclient
208208
return false, err
209209
}
210+
if resp.StatusCode == 429 {
211+
return true, APIError{
212+
ErrorCode: "TOO_MANY_REQUESTS",
213+
Message: "Current request has to be retried",
214+
}
215+
}
210216
if resp.StatusCode >= 400 {
211217
apiError := c.parseError(resp)
212218
return apiError.IsRetriable(), apiError

0 commit comments

Comments
 (0)