feat(core): Setup backend modules (no-changelog) (#14084)

Co-authored-by: Guillaume Jacquart <jacquart.guillaume@gmail.com>
Co-authored-by: Danny Martini <danny@n8n.io>
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-03-20 19:54:27 +01:00
committed by GitHub
parent c34ffd0e7c
commit d80b49d6e5
10 changed files with 149 additions and 3 deletions

View File

@@ -33,6 +33,7 @@ import { ExternalHooks } from '@/external-hooks';
import { ExternalSecretsManager } from '@/external-secrets.ee/external-secrets-manager.ee';
import { License } from '@/license';
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
import { ModulesConfig } from '@/modules/modules.config';
import { NodeTypes } from '@/node-types';
import { PostHogClient } from '@/posthog';
import { ShutdownService } from '@/shutdown/shutdown.service';
@@ -57,6 +58,8 @@ export abstract class BaseCommand extends Command {
protected readonly globalConfig = Container.get(GlobalConfig);
protected readonly modulesConfig = Container.get(ModulesConfig);
/**
* How long to wait for graceful shutdown before force killing the process.
*/
@@ -66,6 +69,13 @@ export abstract class BaseCommand extends Command {
/** Whether to init community packages (if enabled) */
protected needsCommunityPackages = false;
protected async loadModules() {
for (const moduleName of this.modulesConfig.modules) {
await import(`../modules/${moduleName}/${moduleName}.module`);
this.logger.debug(`Loaded module "${moduleName}"`);
}
}
async init(): Promise<void> {
this.errorReporter = Container.get(ErrorReporter);