mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-22 12:19:09 +00:00
fix: Fix workflow deactivating bug
Fix a bug which crashed n8n under some circumstances on shutdown or workflow deactivate and so resulted in other workflows not getting deactviated correctly.
This commit is contained in:
@@ -255,7 +255,16 @@ export class ActiveWorkflows {
|
|||||||
if (workflowData.triggerResponses) {
|
if (workflowData.triggerResponses) {
|
||||||
for (const triggerResponse of workflowData.triggerResponses) {
|
for (const triggerResponse of workflowData.triggerResponses) {
|
||||||
if (triggerResponse.closeFunction) {
|
if (triggerResponse.closeFunction) {
|
||||||
|
try {
|
||||||
await triggerResponse.closeFunction();
|
await triggerResponse.closeFunction();
|
||||||
|
} catch (error) {
|
||||||
|
Logger.error(
|
||||||
|
`There was a problem deactivating trigger of workflow "${id}": "${error.message}"`,
|
||||||
|
{
|
||||||
|
workflowId: id,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -263,7 +272,16 @@ export class ActiveWorkflows {
|
|||||||
if (workflowData.pollResponses) {
|
if (workflowData.pollResponses) {
|
||||||
for (const pollResponse of workflowData.pollResponses) {
|
for (const pollResponse of workflowData.pollResponses) {
|
||||||
if (pollResponse.closeFunction) {
|
if (pollResponse.closeFunction) {
|
||||||
|
try {
|
||||||
await pollResponse.closeFunction();
|
await pollResponse.closeFunction();
|
||||||
|
} catch (error) {
|
||||||
|
Logger.error(
|
||||||
|
`There was a problem deactivating polling trigger of workflow "${id}": "${error.message}"`,
|
||||||
|
{
|
||||||
|
workflowId: id,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user