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.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
|
||||||
|
|||||||
Reference in New Issue
Block a user