mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
🐛 Fix bug that not all Trigger-Nodes got updated/removed
This commit is contained in:
parent
83c49ddd21
commit
8b1fe83cc0
|
@ -75,17 +75,21 @@ export class ActiveWorkflows {
|
|||
const triggerNodes = workflow.getTriggerNodes();
|
||||
|
||||
let triggerResponse: ITriggerResponse | undefined;
|
||||
this.workflowData[id].triggerResponses = [];
|
||||
for (const triggerNode of triggerNodes) {
|
||||
triggerResponse = await workflow.runTrigger(triggerNode, getTriggerFunctions, additionalData, 'trigger');
|
||||
if (triggerResponse !== undefined) {
|
||||
// If a response was given save it
|
||||
this.workflowData[id].triggerResponse = triggerResponse;
|
||||
this.workflowData[id].triggerResponses!.push(triggerResponse);
|
||||
}
|
||||
}
|
||||
|
||||
const pollNodes = workflow.getPollNodes();
|
||||
if (pollNodes.length) {
|
||||
this.workflowData[id].pollResponses = [];
|
||||
for (const pollNode of pollNodes) {
|
||||
this.workflowData[id].pollResponse = await this.activatePolling(pollNode, workflow, additionalData, getPollFunctions);
|
||||
this.workflowData[id].pollResponses!.push(await this.activatePolling(pollNode, workflow, additionalData, getPollFunctions));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -212,12 +216,20 @@ export class ActiveWorkflows {
|
|||
|
||||
const workflowData = this.workflowData[id];
|
||||
|
||||
if (workflowData.triggerResponse && workflowData.triggerResponse.closeFunction) {
|
||||
await workflowData.triggerResponse.closeFunction();
|
||||
if (workflowData.triggerResponses) {
|
||||
for (const triggerResponse of workflowData.triggerResponses) {
|
||||
if (triggerResponse.closeFunction) {
|
||||
await triggerResponse.closeFunction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (workflowData.pollResponse && workflowData.pollResponse.closeFunction) {
|
||||
await workflowData.pollResponse.closeFunction();
|
||||
if (workflowData.pollResponses) {
|
||||
for (const pollResponse of workflowData.pollResponses) {
|
||||
if (pollResponse.closeFunction) {
|
||||
await pollResponse.closeFunction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delete this.workflowData[id];
|
||||
|
|
|
@ -123,7 +123,7 @@ export interface INodeInputDataConnections {
|
|||
|
||||
|
||||
export interface IWorkflowData {
|
||||
pollResponse?: IPollResponse;
|
||||
triggerResponse?: ITriggerResponse;
|
||||
pollResponses?: IPollResponse[];
|
||||
triggerResponses?: ITriggerResponse[];
|
||||
workflow: Workflow;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue