Skip to content

Commit ee9b12b

Browse files
committed
feat(client): retry on 408 Request Timeout (#151)
1 parent ced64a4 commit ee9b12b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ Error codes are as followed:
208208
### Retries
209209

210210
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
211-
Connection errors (for example, due to a network connectivity problem), 409 Conflict, 429 Rate Limit,
212-
and >=500 Internal errors will all be retried by default.
211+
Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
212+
429 Rate Limit, and >=500 Internal errors will all be retried by default.
213213

214214
You can use the `maxRetries` option to configure or disable this:
215215

src/core.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,9 @@ export abstract class APIClient {
463463
if (shouldRetryHeader === 'true') return true;
464464
if (shouldRetryHeader === 'false') return false;
465465

466+
// Retry on request timeouts.
467+
if (response.status === 408) return true;
468+
466469
// Retry on lock timeouts.
467470
if (response.status === 409) return true;
468471

0 commit comments

Comments
 (0)