mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-25 21:54:16 -08:00
Added changes to stop auth attempts after an error
This commit is contained in:
parent
9d71e34a83
commit
f68452c47a
|
@ -413,22 +413,25 @@ exports.radius = function (
|
|||
exports.redisPingAsync = function (dsn) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const client = redis.createClient({
|
||||
url: dsn,
|
||||
url: dsn
|
||||
});
|
||||
client.on("error", (err) => {
|
||||
client.disconnect();
|
||||
reject(err);
|
||||
});
|
||||
client.connect().then(() => {
|
||||
client.ping().then((res, err) => {
|
||||
if (client.isOpen) {
|
||||
client.disconnect();
|
||||
}
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(res);
|
||||
}
|
||||
});
|
||||
if(client.isOpen){
|
||||
client.ping().then((res, err) => {
|
||||
if (client.isOpen) {
|
||||
client.disconnect();
|
||||
}
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(res);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue