Skip to content

Commit 203e851

Browse files
committed
Try harder when downloading failed
It is a rare but not unknown problem that downloading artifacts from Azure Pipelines might fail for transient reasons. Happily, we can just let `curl` do all the hard work of retrying in those instances. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent d1736c9 commit 203e851

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/downloader.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,15 @@ async function unpackTarXZInZipFromURL(
106106
const zipPath = `${tmp}/artifacts.zip`
107107
const curl = spawn(
108108
`${gitForWindowsMINGW64BinPath}/curl.exe`,
109-
['-o', zipPath, url],
109+
[
110+
'--retry',
111+
'16',
112+
'--retry-all-errors',
113+
'--retry-connrefused',
114+
'-o',
115+
zipPath,
116+
url
117+
],
110118
{stdio: [undefined, 'inherit', 'inherit']}
111119
)
112120
await new Promise<void>((resolve, reject) => {

0 commit comments

Comments
 (0)