From 33c70153c8ab1a37b4c3e3cd903c40a956f54ce8 Mon Sep 17 00:00:00 2001 From: Allan Daemon Date: Fri, 26 Mar 2021 15:02:08 -0300 Subject: [PATCH] :bug: Close Redis connection (#1586) Do like in the info command, and after the execution of the other commands, close the connection, otherwise it will kept open and cause a connection and memory leak. Also, as to close in case of error, just in case. --- packages/nodes-base/nodes/Redis/Redis.node.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/nodes-base/nodes/Redis/Redis.node.ts b/packages/nodes-base/nodes/Redis/Redis.node.ts index 716a751d70..3d1aafa962 100644 --- a/packages/nodes-base/nodes/Redis/Redis.node.ts +++ b/packages/nodes-base/nodes/Redis/Redis.node.ts @@ -445,6 +445,7 @@ export class Redis implements INodeType { const operation = this.getNodeParameter('operation', 0) as string; client.on('error', (err: Error) => { + client.quit(); reject(err); }); @@ -518,6 +519,7 @@ export class Redis implements INodeType { } } + client.quit(); resolve(this.prepareOutputData(returnItems)); } });