mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -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];
|
||||
|
||||
w.triggerResponses?.forEach(async (r) => await this.close(r, workflowId, 'trigger'));
|
||||
w.pollResponses?.forEach(async (r) => await this.close(r, workflowId, 'poller'));
|
||||
for (const r of w.triggerResponses ?? []) {
|
||||
await this.close(r, workflowId, 'trigger');
|
||||
}
|
||||
|
||||
for (const r of w.pollResponses ?? []) {
|
||||
await this.close(r, workflowId, 'poller');
|
||||
}
|
||||
|
||||
delete this.activeWorkflows[workflowId];
|
||||
|
||||
|
@ -219,10 +224,7 @@ export class ActiveWorkflows {
|
|||
|
||||
async removeAllTriggerAndPollerBasedWorkflows() {
|
||||
for (const workflowId of Object.keys(this.activeWorkflows)) {
|
||||
const w = this.activeWorkflows[workflowId];
|
||||
|
||||
w.triggerResponses?.forEach(async (r) => await this.close(r, workflowId, 'trigger'));
|
||||
w.pollResponses?.forEach(async (r) => await this.close(r, workflowId, 'poller'));
|
||||
await this.remove(workflowId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue