mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(ci): batch upload screenshot images (#15978)
This commit is contained in:
@@ -56,9 +56,14 @@ class CIScreenshotConnector extends IonicConnector {
|
||||
|
||||
const timespan = this.logger.createTimeSpan(`publishing build started`);
|
||||
const images = currentBuild.screenshots.map(screenshot => screenshot.image);
|
||||
const imageBatches = [];
|
||||
|
||||
for (const image of images) {
|
||||
await this.uploadImage(image);
|
||||
while (images.length > 0) {
|
||||
imageBatches.push(images.splice(0, 10));
|
||||
}
|
||||
|
||||
for (const batch of imageBatches) {
|
||||
await Promise.all(batch.map(async image => this.uploadImage(image)));
|
||||
}
|
||||
|
||||
const buildBuffer = Buffer.from(JSON.stringify(currentBuild, undefined, 2));
|
||||
|
||||
Reference in New Issue
Block a user