'use strict';

const RedisClient  = require('../../../redis/RedisClient');
const healthCheckConstants     = require('../../../../shared/constants/HealthCheckConstants');

exports.check =  (req, res) => {
  return new Promise((resolve, reject) => {
    RedisClient.getRedisClient().ping((err, pong) => {
      if (err) {
        reject(err);
      } else {
        resolve(healthCheckConstants.OK);
      }
    });
  });
};
