1
0
Fork 0

Retry on 413 (#540)

pull/541/head
Konrad Pabjan 2020-08-04 16:57:38 +02:00 committed by GitHub
parent e3c6237940
commit b2cba168a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 3 deletions

View File

@ -33,3 +33,7 @@
- Increase chunk size during upload from 4MB to 8MB - Increase chunk size during upload from 4MB to 8MB
- Improve user-agent strings during API calls to help internally diagnose issues - Improve user-agent strings during API calls to help internally diagnose issues
### 0.3.4
- Retry in the event of a 413 response

View File

@ -192,6 +192,7 @@ describe('Utils', () => {
expect(utils.isRetryableStatusCode(HttpCodes.OK)).toEqual(false) expect(utils.isRetryableStatusCode(HttpCodes.OK)).toEqual(false)
expect(utils.isRetryableStatusCode(HttpCodes.NotFound)).toEqual(false) expect(utils.isRetryableStatusCode(HttpCodes.NotFound)).toEqual(false)
expect(utils.isRetryableStatusCode(HttpCodes.Forbidden)).toEqual(false) expect(utils.isRetryableStatusCode(HttpCodes.Forbidden)).toEqual(false)
expect(utils.isRetryableStatusCode(413)).toEqual(true) // Payload Too Large
}) })
it('Test Throttled Status Code', () => { it('Test Throttled Status Code', () => {

View File

@ -1,6 +1,6 @@
{ {
"name": "@actions/artifact", "name": "@actions/artifact",
"version": "0.3.3", "version": "0.3.4",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@actions/artifact", "name": "@actions/artifact",
"version": "0.3.3", "version": "0.3.4",
"preview": true, "preview": true,
"description": "Actions artifact lib", "description": "Actions artifact lib",
"keywords": [ "keywords": [

View File

@ -74,7 +74,8 @@ export function isRetryableStatusCode(statusCode?: number): boolean {
HttpCodes.BadGateway, HttpCodes.BadGateway,
HttpCodes.ServiceUnavailable, HttpCodes.ServiceUnavailable,
HttpCodes.GatewayTimeout, HttpCodes.GatewayTimeout,
HttpCodes.TooManyRequests HttpCodes.TooManyRequests,
413 // Payload Too Large
] ]
return retryableStatusCodes.includes(statusCode) return retryableStatusCodes.includes(statusCode)
} }