mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
⚡️ Close RabbitMQ connections left open after use (#1594)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user