Skip to content

Commit

Permalink
Reorder back-end plugin deployment to prevent early promise resolution
Browse files Browse the repository at this point in the history
Workaround for eclipse-theia#13638

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
  • Loading branch information
tsmaeder committed Apr 25, 2024
1 parent ae0b3e8 commit a2e2a5a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/plugin-ext/src/main/node/plugin-deployer-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,12 @@ export class PluginDeployerImpl implements PluginDeployer {
const pluginPaths = [...acceptedBackendPlugins, ...acceptedHeadlessPlugins].map(pluginEntry => pluginEntry.path());
this.logger.debug('local path to deploy on remote instance', pluginPaths);

const deployments = await Promise.all([
// headless plugins are deployed like backend plugins
this.pluginDeployerHandler.deployBackendPlugins(acceptedHeadlessPlugins),
// start the backend plugins
this.pluginDeployerHandler.deployBackendPlugins(acceptedBackendPlugins),
this.pluginDeployerHandler.deployFrontendPlugins(acceptedFrontendPlugins)
]);
const deployments = [];
// start the backend plugins
deployments.push(await this.pluginDeployerHandler.deployBackendPlugins(acceptedBackendPlugins));
// headless plugins are deployed like backend plugins
deployments.push(await this.pluginDeployerHandler.deployBackendPlugins(acceptedHeadlessPlugins));
deployments.push(await this.pluginDeployerHandler.deployFrontendPlugins(acceptedFrontendPlugins));
this.onDidDeployEmitter.fire(undefined);
return deployments.reduce<number>((accumulated, current) => accumulated += current ?? 0, 0);
}
Expand Down

0 comments on commit a2e2a5a

Please sign in to comment.