🐛 Fix issue of Redis never returning (#1716)

Fixes #1709. When the node returned an error the reject method was not called. Hence, the process kept running forever.
This commit is contained in:
Ricardo Espinoza 2021-04-30 16:38:51 -04:00 committed by GitHub
parent 7c418aafe7
commit efd40ea7a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -451,7 +451,7 @@ export class Redis implements INodeType {
}); });
client.on('ready', async (err: Error | null) => { client.on('ready', async (err: Error | null) => {
try {
if (operation === 'info') { if (operation === 'info') {
const clientInfo = util.promisify(client.info).bind(client); const clientInfo = util.promisify(client.info).bind(client);
const result = await clientInfo(); const result = await clientInfo();
@ -523,6 +523,9 @@ export class Redis implements INodeType {
client.quit(); client.quit();
resolve(this.prepareOutputData(returnItems)); resolve(this.prepareOutputData(returnItems));
} }
} catch (error) {
reject(error);
}
}); });
}); });
} }