Limit merge download concurrency

This commit is contained in:
openai-code-agent[bot] 2026-02-14 10:31:50 +00:00
parent 158f1d7c55
commit 8c1844414d
2 changed files with 18 additions and 19 deletions

16
dist/merge/index.js vendored
View File

@ -81569,14 +81569,14 @@ function run() {
artifacts.forEach(artifact => {
core.info(`- ${artifact.name} (ID: ${artifact.id}, Size: ${artifact.size})`);
});
const downloadPromises = artifacts.map(artifact => artifact_1.default.downloadArtifact(artifact.id, {
path: inputs.separateDirectories
? path.join(tmpDir, artifact.name)
: tmpDir
}));
const chunkedPromises = (0, exports.chunk)(downloadPromises, PARALLEL_DOWNLOADS);
for (const chunk of chunkedPromises) {
yield Promise.all(chunk);
const chunkedArtifacts = (0, exports.chunk)(artifacts, PARALLEL_DOWNLOADS);
for (const artifactChunk of chunkedArtifacts) {
const downloadPromises = artifactChunk.map(artifact => artifact_1.default.downloadArtifact(artifact.id, {
path: inputs.separateDirectories
? path.join(tmpDir, artifact.name)
: tmpDir
}));
yield Promise.all(downloadPromises);
}
const options = {};
if (inputs.retentionDays) {

View File

@ -40,17 +40,16 @@ export async function run(): Promise<void> {
core.info(`- ${artifact.name} (ID: ${artifact.id}, Size: ${artifact.size})`)
})
const downloadPromises = artifacts.map(artifact =>
artifactClient.downloadArtifact(artifact.id, {
path: inputs.separateDirectories
? path.join(tmpDir, artifact.name)
: tmpDir
})
)
const chunkedPromises = chunk(downloadPromises, PARALLEL_DOWNLOADS)
for (const chunk of chunkedPromises) {
await Promise.all(chunk)
const chunkedArtifacts = chunk(artifacts, PARALLEL_DOWNLOADS)
for (const artifactChunk of chunkedArtifacts) {
const downloadPromises = artifactChunk.map(artifact =>
artifactClient.downloadArtifact(artifact.id, {
path: inputs.separateDirectories
? path.join(tmpDir, artifact.name)
: tmpDir
})
)
await Promise.all(downloadPromises)
}
const options: UploadArtifactOptions = {}