mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(core): Fix removal of triggers and pollers from memory on deactivation in multi-main setup (#8416)
This commit is contained in:
parent
a0a1830696
commit
2257ec63b3
|
@ -209,8 +209,13 @@ export class ActiveWorkflows {
|
||||||
|
|
||||||
const w = this.activeWorkflows[workflowId];
|
const w = this.activeWorkflows[workflowId];
|
||||||
|
|
||||||
w.triggerResponses?.forEach(async (r) => await this.close(r, workflowId, 'trigger'));
|
for (const r of w.triggerResponses ?? []) {
|
||||||
w.pollResponses?.forEach(async (r) => await this.close(r, workflowId, 'poller'));
|
await this.close(r, workflowId, 'trigger');
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const r of w.pollResponses ?? []) {
|
||||||
|
await this.close(r, workflowId, 'poller');
|
||||||
|
}
|
||||||
|
|
||||||
delete this.activeWorkflows[workflowId];
|
delete this.activeWorkflows[workflowId];
|
||||||
|
|
||||||
|
@ -219,10 +224,7 @@ export class ActiveWorkflows {
|
||||||
|
|
||||||
async removeAllTriggerAndPollerBasedWorkflows() {
|
async removeAllTriggerAndPollerBasedWorkflows() {
|
||||||
for (const workflowId of Object.keys(this.activeWorkflows)) {
|
for (const workflowId of Object.keys(this.activeWorkflows)) {
|
||||||
const w = this.activeWorkflows[workflowId];
|
await this.remove(workflowId);
|
||||||
|
|
||||||
w.triggerResponses?.forEach(async (r) => await this.close(r, workflowId, 'trigger'));
|
|
||||||
w.pollResponses?.forEach(async (r) => await this.close(r, workflowId, 'poller'));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue