mirror of
https://github.com/gradle/actions.git
synced 2025-08-25 03:11:28 +08:00
Try to remove retries
This commit is contained in:
parent
d45eec9a5e
commit
aac6626d42
@ -44,6 +44,7 @@
|
|||||||
"cheerio": "1.1.0",
|
"cheerio": "1.1.0",
|
||||||
"semver": "7.7.2",
|
"semver": "7.7.2",
|
||||||
"string-argv": "0.3.2",
|
"string-argv": "0.3.2",
|
||||||
|
"typed-rest-client": "2.1.0",
|
||||||
"unhomoglyph": "1.0.6",
|
"unhomoglyph": "1.0.6",
|
||||||
"which": "5.0.0"
|
"which": "5.0.0"
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import * as httpm from 'typed-rest-client/HttpClient'
|
||||||
import * as cheerio from 'cheerio'
|
import * as cheerio from 'cheerio'
|
||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import * as httpm from '@actions/http-client'
|
//import * as httpm from '@actions/http-client'
|
||||||
|
|
||||||
import fileWrapperChecksums from './wrapper-checksums.json'
|
import fileWrapperChecksums from './wrapper-checksums.json'
|
||||||
|
|
||||||
@ -69,20 +70,23 @@ async function httpGetJsonArray(url: string): Promise<unknown[]> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function httpGetText(url: string): Promise<string> {
|
async function httpGetText(url: string): Promise<string> {
|
||||||
const maxAttempts = 4
|
|
||||||
let attempts = 0
|
|
||||||
while (attempts < maxAttempts) {
|
|
||||||
try {
|
|
||||||
const response = await httpc.get(url)
|
const response = await httpc.get(url)
|
||||||
return await response.readBody()
|
return await response.readBody()
|
||||||
} catch (error) {
|
|
||||||
attempts++
|
// const maxAttempts = 4
|
||||||
if (attempts === maxAttempts) {
|
// let attempts = 0
|
||||||
return new Promise((_resolve, reject) => reject(error))
|
// while (attempts < maxAttempts) {
|
||||||
}
|
// try {
|
||||||
}
|
// const response = await httpc.get(url)
|
||||||
}
|
// return await response.readBody()
|
||||||
return new Promise((_resolve, reject) => reject(new Error('Illegal state')))
|
// } catch (error) {
|
||||||
|
// attempts++
|
||||||
|
// if (attempts === maxAttempts) {
|
||||||
|
// return new Promise((_resolve, reject) => reject(error))
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return new Promise((_resolve, reject) => reject(new Error('Illegal state')))
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addDistributionSnapshotChecksumUrls(checksumUrls: [string, string][]): Promise<void> {
|
async function addDistributionSnapshotChecksumUrls(checksumUrls: [string, string][]): Promise<void> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user