|
|
@ -413,12 +413,14 @@ 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(() => {
|
|
|
|
|
|
|
|
if(client.isOpen){
|
|
|
|
client.ping().then((res, err) => {
|
|
|
|
client.ping().then((res, err) => {
|
|
|
|
if (client.isOpen) {
|
|
|
|
if (client.isOpen) {
|
|
|
|
client.disconnect();
|
|
|
|
client.disconnect();
|
|
|
@ -429,6 +431,7 @@ exports.redisPingAsync = function (dsn) {
|
|
|
|
resolve(res);
|
|
|
|
resolve(res);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|