File tree Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -240,13 +240,30 @@ export async function get(
240
240
)
241
241
}
242
242
const url = filtered [ 0 ] . resource . downloadUrl
243
- await unzip (
244
- url ,
245
- `${ artifactName } /` ,
246
- outputDirectory ,
247
- verbose ,
248
- flavor === 'full' ? unpackTarXZInZipFromURL : undefined
249
- )
243
+ let delayInSeconds = 1
244
+ for ( ; ; ) {
245
+ try {
246
+ await unzip (
247
+ url ,
248
+ `${ artifactName } /` ,
249
+ outputDirectory ,
250
+ verbose ,
251
+ flavor === 'full' ? unpackTarXZInZipFromURL : undefined
252
+ )
253
+ break
254
+ } catch ( e ) {
255
+ delayInSeconds *= 2
256
+ if ( delayInSeconds >= 60 ) {
257
+ throw e
258
+ }
259
+ process . stderr . write (
260
+ `Encountered problem downloading/extracting ${ url } : ${ e } ; Retrying in ${ delayInSeconds } seconds...\n`
261
+ )
262
+ await new Promise ( ( resolve , _reject ) =>
263
+ setTimeout ( resolve , delayInSeconds * 1000 )
264
+ )
265
+ }
266
+ }
250
267
}
251
268
return { artifactName, download, id}
252
269
}
You can’t perform that action at this time.
0 commit comments