mirror of https://github.com/actions/toolkit
linter
parent
8c317a0e59
commit
f732e4cd62
|
@ -62,7 +62,7 @@ class ArtifactHttpClient implements Rpc {
|
||||||
const {body} = await this.retryableRequest(async () =>
|
const {body} = await this.retryableRequest(async () =>
|
||||||
this.httpClient.post(url, JSON.stringify(data), headers)
|
this.httpClient.post(url, JSON.stringify(data), headers)
|
||||||
)
|
)
|
||||||
|
|
||||||
return JSON.parse(body)
|
return JSON.parse(body)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new Error(`Failed to ${method}: ${error.message}`)
|
throw new Error(`Failed to ${method}: ${error.message}`)
|
||||||
|
@ -71,7 +71,7 @@ class ArtifactHttpClient implements Rpc {
|
||||||
|
|
||||||
async retryableRequest(
|
async retryableRequest(
|
||||||
operation: () => Promise<HttpClientResponse>
|
operation: () => Promise<HttpClientResponse>
|
||||||
): Promise<{response: HttpClientResponse, body: string}> {
|
): Promise<{response: HttpClientResponse; body: string}> {
|
||||||
let attempt = 0
|
let attempt = 0
|
||||||
let errorMessage = ''
|
let errorMessage = ''
|
||||||
while (attempt < this.maxAttempts) {
|
while (attempt < this.maxAttempts) {
|
||||||
|
|
Loading…
Reference in New Issue