Skip to content

Commit 5aed66d

Browse files
committed
Wait for tools to be downloaded before upload
1 parent fc503b0 commit 5aed66d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/socket-daemon.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,19 +459,24 @@ export default class SocketDaemon extends Daemon {
459459
* ]
460460
* }
461461
*/
462-
_upload(uploadPayload, uploadCommandInfo) {
462+
async _upload(uploadPayload, uploadCommandInfo) {
463+
// Wait for tools to be installed
463464
if (Array.isArray(uploadCommandInfo.tools)) {
465+
const promises = [];
466+
464467
uploadCommandInfo.tools.forEach(tool => {
465468
if (this.v2) {
466469
this.downloading.next({ status: this.DOWNLOAD_IN_PROGRESS });
467-
this.v2.installTool(tool).then(() => {
470+
promises.push(this.v2.installTool(tool).then(() => {
468471
this.downloading.next({ status: this.DOWNLOAD_DONE });
469-
});
472+
}));
470473
}
471474
else {
472475
this.downloadTool(tool.name, tool.version, tool.packager);
473476
}
474477
});
478+
479+
await Promise.all(promises);
475480
}
476481

477482
const socketParameters = {

0 commit comments

Comments
 (0)