mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 02:51:14 +00:00
refactor(core): Centralize module management (#16464)
Co-authored-by: Danny Martini <danny@n8n.io>
This commit is contained in:
@@ -72,19 +72,7 @@ export abstract class BaseCommand extends Command {
|
||||
protected needsTaskRunner = false;
|
||||
|
||||
protected async loadModules() {
|
||||
for (const moduleName of this.modulesConfig.modules) {
|
||||
// add module to the registry for dependency injection
|
||||
try {
|
||||
await import(`../modules/${moduleName}/${moduleName}.module`);
|
||||
} catch {
|
||||
await import(`../modules/${moduleName}.ee/${moduleName}.module`);
|
||||
}
|
||||
|
||||
this.modulesConfig.addLoadedModule(moduleName);
|
||||
this.logger.debug(`Loaded module "${moduleName}"`);
|
||||
}
|
||||
|
||||
this.moduleRegistry.addEntities();
|
||||
await this.moduleRegistry.loadModules();
|
||||
}
|
||||
|
||||
async init(): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user