Added changes to stop auth attempts after an error

This commit is contained in:
Kenneth Foster 2023-06-09 14:54:17 -04:00
parent 9d71e34a83
commit f68452c47a

View file

@ -413,22 +413,25 @@ exports.radius = function (
exports.redisPingAsync = function (dsn) { exports.redisPingAsync = function (dsn) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const client = redis.createClient({ const client = redis.createClient({
url: dsn, url: dsn
}); });
client.on("error", (err) => { client.on("error", (err) => {
client.disconnect();
reject(err); reject(err);
}); });
client.connect().then(() => { client.connect().then(() => {
client.ping().then((res, err) => { if(client.isOpen){
if (client.isOpen) { client.ping().then((res, err) => {
client.disconnect(); if (client.isOpen) {
} client.disconnect();
if (err) { }
reject(err); if (err) {
} else { reject(err);
resolve(res); } else {
} resolve(res);
}); }
});
}
}); });
}); });
}; };