Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't await plugin deployment in backend process #13134

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class I18nPreloadContribution implements PreloadContribution {
locale: defaultLocale
});
}
if (nls.locale) {
if (nls.locale && nls.locale !== nls.defaultLocale) {
const localization = await this.localizationServer.loadLocalization(nls.locale);
if (localization.languagePack) {
nls.localization = localization;
Expand Down
22 changes: 17 additions & 5 deletions packages/plugin-ext/src/hosted/browser/hosted-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,12 @@ export class HostedPluginSupport {
waitPluginsMeasurement.error('Backend deployment failed.');
}
}

syncPluginsMeasurement?.log(`Sync of ${this.getPluginCount(initialized)}`);
if (initialized > 0) {
// Only log sync measurement if there are were plugins to sync.
syncPluginsMeasurement?.log(`Sync of ${this.getPluginCount(initialized)}`);
} else {
syncPluginsMeasurement.stop();
}
}

/**
Expand Down Expand Up @@ -416,8 +420,12 @@ export class HostedPluginSupport {
}));
}
}

loadPluginsMeasurement.log(`Load contributions of ${this.getPluginCount(loaded)}`);
if (loaded > 0) {
// Only log load measurement if there are were plugins to load.
loadPluginsMeasurement?.log(`Load contributions of ${this.getPluginCount(loaded)}`);
} else {
loadPluginsMeasurement.stop();
}

return hostContributions;
}
Expand Down Expand Up @@ -488,7 +496,11 @@ export class HostedPluginSupport {
return;
}

startPluginsMeasurement.log(`Start of ${this.getPluginCount(started)}`);
if (started > 0) {
startPluginsMeasurement.log(`Start of ${this.getPluginCount(started)}`);
} else {
startPluginsMeasurement.stop();
}
}

protected async obtainManager(host: string, hostContributions: PluginContributions[], toDisconnect: DisposableCollection): Promise<PluginManagerExt | undefined> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class PluginDeployerContribution implements BackendApplicationContributio
@inject(PluginDeployer)
protected pluginDeployer: PluginDeployer;

initialize(): Promise<void> {
return this.pluginDeployer.start();
initialize(): void {
this.pluginDeployer.start().catch(error => this.logger.error('Initializing plugin deployer failed.', error));
}
}
3 changes: 2 additions & 1 deletion packages/plugin-ext/src/main/node/plugin-deployer-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ export class PluginDeployerImpl implements PluginDeployer {
id,
type: PluginType.System
}));
const resolvePlugins = this.measure('resolvePlugins');
const plugins = await this.resolvePlugins([...unresolvedUserEntries, ...unresolvedSystemEntries]);
deployPlugins.log('Resolve plugins list');
resolvePlugins.log('Resolve plugins list');
await this.deployPlugins(plugins);
deployPlugins.log('Deploy plugins list');
}
Expand Down
Loading