🐛 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.
This commit is contained in:
Allan Daemon 2021-03-26 15:02:08 -03:00 committed by GitHub
parent 2753566e0a
commit 33c70153c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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));
}
});