🐛 Fix bug with internal hooks and CLI workflow execution

This commit is contained in:
Jan Oberhauser 2021-11-09 22:04:45 +01:00
parent 27543fcdd4
commit 653a8bb42e
2 changed files with 14 additions and 6 deletions

View file

@ -11,6 +11,7 @@ import {
CredentialTypes, CredentialTypes,
Db, Db,
ExternalHooks, ExternalHooks,
InternalHooksManager,
IWorkflowBase, IWorkflowBase,
IWorkflowExecutionDataProcess, IWorkflowExecutionDataProcess,
LoadNodesAndCredentials, LoadNodesAndCredentials,
@ -123,6 +124,9 @@ export class Execute extends Command {
const externalHooks = ExternalHooks(); const externalHooks = ExternalHooks();
await externalHooks.init(); await externalHooks.init();
const instanceId = await UserSettings.getInstanceId();
InternalHooksManager.init(instanceId);
// Add the found types to an instance other parts of the application can use // Add the found types to an instance other parts of the application can use
const nodeTypes = NodeTypes(); const nodeTypes = NodeTypes();
await nodeTypes.init(loadNodesAndCredentials.nodeTypes); await nodeTypes.init(loadNodesAndCredentials.nodeTypes);

View file

@ -28,6 +28,7 @@ import {
CredentialTypes, CredentialTypes,
Db, Db,
ExternalHooks, ExternalHooks,
InternalHooksManager,
IWorkflowDb, IWorkflowDb,
IWorkflowExecutionDataProcess, IWorkflowExecutionDataProcess,
LoadNodesAndCredentials, LoadNodesAndCredentials,
@ -55,12 +56,12 @@ export class ExecuteBatch extends Command {
static executionTimeout = 3 * 60 * 1000; static executionTimeout = 3 * 60 * 1000;
static examples = [ static examples = [
`$ n8n executeAll`, `$ n8n executeBatch`,
`$ n8n executeAll --concurrency=10 --skipList=/data/skipList.txt`, `$ n8n executeBatch --concurrency=10 --skipList=/data/skipList.txt`,
`$ n8n executeAll --debug --output=/data/output.json`, `$ n8n executeBatch --debug --output=/data/output.json`,
`$ n8n executeAll --ids=10,13,15 --shortOutput`, `$ n8n executeBatch --ids=10,13,15 --shortOutput`,
`$ n8n executeAll --snapshot=/data/snapshots --shallow`, `$ n8n executeBatch --snapshot=/data/snapshots --shallow`,
`$ n8n executeAll --compare=/data/previousExecutionData --retries=2`, `$ n8n executeBatch --compare=/data/previousExecutionData --retries=2`,
]; ];
static flags = { static flags = {
@ -303,6 +304,9 @@ export class ExecuteBatch extends Command {
const externalHooks = ExternalHooks(); const externalHooks = ExternalHooks();
await externalHooks.init(); await externalHooks.init();
const instanceId = await UserSettings.getInstanceId();
InternalHooksManager.init(instanceId);
// Add the found types to an instance other parts of the application can use // Add the found types to an instance other parts of the application can use
const nodeTypes = NodeTypes(); const nodeTypes = NodeTypes();
await nodeTypes.init(loadNodesAndCredentials.nodeTypes); await nodeTypes.init(loadNodesAndCredentials.nodeTypes);