|
|
|
@ -505,12 +505,16 @@ exports.radius = function (
|
|
|
|
|
/**
|
|
|
|
|
* Redis server ping
|
|
|
|
|
* @param {string} dsn The redis connection string
|
|
|
|
|
* @returns {Promise<any>} Response from redis server
|
|
|
|
|
* @param {boolean} rejectUnauthorized If false, allows unverified server certificates.
|
|
|
|
|
* @returns {Promise<any>} Response from server
|
|
|
|
|
*/
|
|
|
|
|
exports.redisPingAsync = function (dsn) {
|
|
|
|
|
exports.redisPingAsync = function (dsn, rejectUnauthorized) {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
const client = redis.createClient({
|
|
|
|
|
url: dsn
|
|
|
|
|
url: dsn,
|
|
|
|
|
socket: {
|
|
|
|
|
rejectUnauthorized
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
client.on("error", (err) => {
|
|
|
|
|
if (client.isOpen) {
|
|
|
|
|