mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
🐛 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:
parent
2753566e0a
commit
33c70153c8
|
@ -445,6 +445,7 @@ export class Redis implements INodeType {
|
||||||
const operation = this.getNodeParameter('operation', 0) as string;
|
const operation = this.getNodeParameter('operation', 0) as string;
|
||||||
|
|
||||||
client.on('error', (err: Error) => {
|
client.on('error', (err: Error) => {
|
||||||
|
client.quit();
|
||||||
reject(err);
|
reject(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -518,6 +519,7 @@ export class Redis implements INodeType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
client.quit();
|
||||||
resolve(this.prepareOutputData(returnItems));
|
resolve(this.prepareOutputData(returnItems));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue