mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 20:54:07 -08:00
refactor(core): Prevent community packages queries if feature is disabled (#6728)
This commit is contained in:
parent
eeb49e9375
commit
e1e6d4a749
|
@ -221,6 +221,17 @@ export class Start extends BaseCommand {
|
|||
|
||||
await this.loadNodesAndCredentials.generateTypesForFrontend();
|
||||
|
||||
await UserSettings.getEncryptionKey();
|
||||
|
||||
// Load settings from database and set them to config.
|
||||
const databaseSettings = await Db.collections.Settings.findBy({ loadOnStartup: true });
|
||||
databaseSettings.forEach((setting) => {
|
||||
config.set(setting.key, jsonParse(setting.value, { fallbackValue: setting.value }));
|
||||
});
|
||||
|
||||
const areCommunityPackagesEnabled = config.getEnv('nodes.communityPackages.enabled');
|
||||
|
||||
if (areCommunityPackagesEnabled) {
|
||||
const installedPackages = await getAllInstalledPackages();
|
||||
const missingPackages = new Set<{
|
||||
packageName: string;
|
||||
|
@ -238,14 +249,6 @@ export class Start extends BaseCommand {
|
|||
});
|
||||
});
|
||||
|
||||
await UserSettings.getEncryptionKey();
|
||||
|
||||
// Load settings from database and set them to config.
|
||||
const databaseSettings = await Db.collections.Settings.findBy({ loadOnStartup: true });
|
||||
databaseSettings.forEach((setting) => {
|
||||
config.set(setting.key, jsonParse(setting.value, { fallbackValue: setting.value }));
|
||||
});
|
||||
|
||||
config.set('nodes.packagesMissing', '');
|
||||
if (missingPackages.size) {
|
||||
LoggerProxy.error(
|
||||
|
@ -277,6 +280,7 @@ export class Start extends BaseCommand {
|
|||
.join(' '),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const dbType = config.getEnv('database.type');
|
||||
if (dbType === 'sqlite') {
|
||||
|
|
Loading…
Reference in a new issue