Skip to content

Commit

Permalink
Retry on 413 (actions#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
konradpabjan authored Aug 4, 2020
1 parent e3c6237 commit b2cba16
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/artifact/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@

- Increase chunk size during upload from 4MB to 8MB
- Improve user-agent strings during API calls to help internally diagnose issues

### 0.3.4

- Retry in the event of a 413 response
1 change: 1 addition & 0 deletions packages/artifact/__tests__/util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ describe('Utils', () => {
expect(utils.isRetryableStatusCode(HttpCodes.OK)).toEqual(false)
expect(utils.isRetryableStatusCode(HttpCodes.NotFound)).toEqual(false)
expect(utils.isRetryableStatusCode(HttpCodes.Forbidden)).toEqual(false)
expect(utils.isRetryableStatusCode(413)).toEqual(true) // Payload Too Large
})

it('Test Throttled Status Code', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/artifact/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/artifact/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@actions/artifact",
"version": "0.3.3",
"version": "0.3.4",
"preview": true,
"description": "Actions artifact lib",
"keywords": [
Expand Down
3 changes: 2 additions & 1 deletion packages/artifact/src/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ export function isRetryableStatusCode(statusCode?: number): boolean {
HttpCodes.BadGateway,
HttpCodes.ServiceUnavailable,
HttpCodes.GatewayTimeout,
HttpCodes.TooManyRequests
HttpCodes.TooManyRequests,
413 // Payload Too Large
]
return retryableStatusCodes.includes(statusCode)
}
Expand Down

0 comments on commit b2cba16

Please sign in to comment.