mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08: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:
parent
bb3fa05318
commit
195f104ef5
|
@ -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,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue