Skip to content

Commit

Permalink
Parallel builds download
Browse files Browse the repository at this point in the history
  • Loading branch information
ichina authored and rams23 committed May 8, 2024
1 parent 69ffcdf commit f290e90
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/cli/src/application/cloud/buildsManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,13 @@ export async function downloadBuild(buildId: string, projectConfig: ProjectConfi
const adapter = getRemoteStorage(projectConfig);
const build = await adapter.getBuildInfo(buildId);
logger.info(`Found ${build.androidBuilds.length} android builds and ${build.iosBuilds.length} ios builds`);
// todo improve parallelism
for (const buildInfo of build.androidBuilds) {
const androidBuildsProms = build.androidBuilds.map(async buildInfo => {
const tempZipPath = await downloadZipBuild(buildInfo, buildId, adapter);
const destinationFolder = path.join(getBuildFolderByBuildId(buildId), 'android', buildInfo.flavor, buildInfo.type);
await unzipFile(tempZipPath, destinationFolder);
fs.rmSync(tempZipPath);
}
for (const buildInfo of build.iosBuilds) {
});
const iosBuildsProms = build.iosBuilds.map(async buildInfo => {
const tempZipPath = await downloadZipBuild(buildInfo, buildId, adapter);
const destinationFolder = path.join(
getRootDestinationFolder(),
Expand All @@ -101,7 +100,8 @@ export async function downloadBuild(buildId: string, projectConfig: ProjectConfi

await unzipFile(tempZipPath, destinationFolder);
fs.rmSync(tempZipPath);
}
});
await Promise.all([...androidBuildsProms, ...iosBuildsProms]);
}

export async function makeCurrentBuild(buildId: string) {
Expand Down

0 comments on commit f290e90

Please sign in to comment.