mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00: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:
@@ -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));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user