mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -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.connection.close();
|
||||
}
|
||||
else if (mode === 'exchange') {
|
||||
const exchange = this.getNodeParameter('exchange', 0) as string;
|
||||
|
@ -419,6 +420,7 @@ export class RabbitMQ implements INodeType {
|
|||
});
|
||||
|
||||
await channel.close();
|
||||
await channel.connection.close();
|
||||
} else {
|
||||
throw new Error(`The operation "${mode}" is not known!`);
|
||||
}
|
||||
|
@ -428,6 +430,7 @@ export class RabbitMQ implements INodeType {
|
|||
catch (error) {
|
||||
if (channel) {
|
||||
await channel.close();
|
||||
await channel.connection.close();
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
|
|
@ -151,6 +151,7 @@ export class RabbitMQTrigger implements INodeType {
|
|||
// the workflow gets deactivated and can so clean up.
|
||||
async function closeFunction() {
|
||||
await channel.close();
|
||||
await channel.connection.close();
|
||||
}
|
||||
|
||||
// The "manualTriggerFunction" function gets called by n8n
|
||||
|
|
Loading…
Reference in a new issue