mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +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) {
|
||||
for (const triggerResponse of workflowData.triggerResponses) {
|
||||
if (triggerResponse.closeFunction) {
|
||||
await triggerResponse.closeFunction();
|
||||
try {
|
||||
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) {
|
||||
for (const pollResponse of workflowData.pollResponses) {
|
||||
if (pollResponse.closeFunction) {
|
||||
await pollResponse.closeFunction();
|
||||
try {
|
||||
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