Skip to content

Commit 40a8c8b

Browse files
authored
feat: don't retry on HTTP 410 (#621)
* Retry on HTTP 410 * Update README
1 parent 470ac38 commit 40a8c8b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# plugin-retry.js
22

3-
> Retries requests for server 4xx/5xx responses except `400`, `401`, `403`, `404`, `422`, and `451`.
3+
> Retries requests for server 4xx/5xx responses except `400`, `401`, `403`, `404`, `410`, `422`, and `451`.
44
55
[![@latest](https://img.shields.io/npm/v/@octokit/plugin-retry.svg)](https://www.npmjs.com/package/@octokit/plugin-retry)
66
[![Build Status](https://github.com/octokit/plugin-retry.js/workflows/Test/badge.svg)](https://github.com/octokit/plugin-retry.js/actions?workflow=Test)

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function retry(octokit: Octokit, octokitOptions: any) {
1111
{
1212
enabled: true,
1313
retryAfterBaseValue: 1000,
14-
doNotRetry: [400, 401, 403, 404, 422, 451],
14+
doNotRetry: [400, 401, 403, 404, 410, 422, 451],
1515
retries: 3,
1616
},
1717
octokitOptions.retry,

test/retry.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,10 @@ describe("Automatic Retries", function () {
206206
expect(ms2).toBeGreaterThan(420);
207207
});
208208

209-
it("Should not retry 3xx/400/401/403/422/451 errors", async function () {
209+
it("Should not retry 3xx/400/401/403/410/422/451 errors", async function () {
210210
const octokit = new TestOctokit({ retry: { retryAfterBaseValue: 50 } });
211211
let caught = 0;
212-
const testStatuses = [304, 400, 401, 403, 404, 422, 451];
212+
const testStatuses = [304, 400, 401, 403, 404, 410, 422, 451];
213213

214214
for (const status of testStatuses) {
215215
try {

0 commit comments

Comments
 (0)