mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
⚡️ Close RabbitMQ connections left open after use (#1594)
This commit is contained in:
parent
8ed1099795
commit
f4916c7efb
|
@ -355,6 +355,7 @@ export class RabbitMQ implements INodeType {
|
||||||
});
|
});
|
||||||
|
|
||||||
await channel.close();
|
await channel.close();
|
||||||
|
await channel.connection.close();
|
||||||
}
|
}
|
||||||
else if (mode === 'exchange') {
|
else if (mode === 'exchange') {
|
||||||
const exchange = this.getNodeParameter('exchange', 0) as string;
|
const exchange = this.getNodeParameter('exchange', 0) as string;
|
||||||
|
@ -419,6 +420,7 @@ export class RabbitMQ implements INodeType {
|
||||||
});
|
});
|
||||||
|
|
||||||
await channel.close();
|
await channel.close();
|
||||||
|
await channel.connection.close();
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`The operation "${mode}" is not known!`);
|
throw new Error(`The operation "${mode}" is not known!`);
|
||||||
}
|
}
|
||||||
|
@ -428,6 +430,7 @@ export class RabbitMQ implements INodeType {
|
||||||
catch (error) {
|
catch (error) {
|
||||||
if (channel) {
|
if (channel) {
|
||||||
await channel.close();
|
await channel.close();
|
||||||
|
await channel.connection.close();
|
||||||
}
|
}
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,6 +151,7 @@ export class RabbitMQTrigger implements INodeType {
|
||||||
// the workflow gets deactivated and can so clean up.
|
// the workflow gets deactivated and can so clean up.
|
||||||
async function closeFunction() {
|
async function closeFunction() {
|
||||||
await channel.close();
|
await channel.close();
|
||||||
|
await channel.connection.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
// The "manualTriggerFunction" function gets called by n8n
|
// The "manualTriggerFunction" function gets called by n8n
|
||||||
|
|
Loading…
Reference in a new issue