mirror of
https://github.com/actions/download-artifact.git
synced 2024-11-22 00:51:06 -05:00
fix: correctly handle parallel downloading
This commit is contained in:
parent
fa0a91b85d
commit
ac50dab596
1 changed files with 2 additions and 2 deletions
|
@ -111,7 +111,7 @@ async function run(): Promise<void> {
|
|||
})
|
||||
}
|
||||
|
||||
const downloadPromises = artifacts.map(artifact =>
|
||||
const downloadPromises = artifacts.map(artifact => () =>
|
||||
artifactClient.downloadArtifact(artifact.id, {
|
||||
...options,
|
||||
path:
|
||||
|
@ -123,7 +123,7 @@ async function run(): Promise<void> {
|
|||
|
||||
const chunkedPromises = chunk(downloadPromises, PARALLEL_DOWNLOADS)
|
||||
for (const chunk of chunkedPromises) {
|
||||
await Promise.all(chunk)
|
||||
await Promise.all(chunk.map(fn => fn()))
|
||||
}
|
||||
|
||||
core.info(`Total of ${artifacts.length} artifact(s) downloaded`)
|
||||
|
|
Loading…
Reference in a new issue