mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
refactor(core): Use an IoC container to manage singleton classes [Part-1] (no-changelog) (#5509)
* add typedi * convert ActiveWorkflowRunner into an injectable service * convert ExternalHooks into an injectable service * convert InternalHooks into an injectable service * convert LoadNodesAndCredentials into an injectable service * convert NodeTypes and CredentialTypes into an injectable service * convert ActiveExecutions into an injectable service * convert WaitTracker into an injectable service * convert Push into an injectable service * convert ActiveWebhooks and TestWebhooks into an injectable services * handle circular references, and log errors when a circular dependency is found
This commit is contained in:
committed by
GitHub
parent
aca94bb995
commit
52f740b9e8
@@ -3,6 +3,7 @@ import { getTablePrefix, logMigrationEnd, logMigrationStart } from '@db/utils/mi
|
||||
import { NodeTypes } from '@/NodeTypes';
|
||||
import { IConnections, INode } from 'n8n-workflow';
|
||||
import { getLogger } from '@/Logger';
|
||||
import { Container } from 'typedi';
|
||||
|
||||
export class PurgeInvalidWorkflowConnections1675940580449 implements MigrationInterface {
|
||||
name = 'PurgeInvalidWorkflowConnections1675940580449';
|
||||
@@ -18,7 +19,7 @@ export class PurgeInvalidWorkflowConnections1675940580449 implements MigrationIn
|
||||
FROM "${tablePrefix}workflow_entity"
|
||||
`);
|
||||
|
||||
const nodeTypes = NodeTypes();
|
||||
const nodeTypes = Container.get(NodeTypes);
|
||||
|
||||
workflows.forEach(async (workflow) => {
|
||||
let connections: IConnections = JSON.parse(workflow.connections);
|
||||
|
||||
Reference in New Issue
Block a user