/**
 * @name: connectionRedis
 * @author: alan
 * @date: 2022-09-15 14:41
 * @description：connectionRedis
 * @update: 2022-09-15 14:41
 */
const redis = require('redis');
console.log('--redis', redis);
var RDS_PORT = 6379;
var RDS_HOST = '192.168.121.5';
var RDS_PWD = 'Uu49Kz1olY85HQBu';
const opts = {
  auth_pass: RDS_PWD,
}
const client = redis.createClient({
  url: 'redis://192.168.121.5:6379',
  auth_pass: 'Uu49Kz1olY85HQBu',
  password: 'Uu49Kz1olY85HQBu',
  db: 'db1'
});
client.on('connect', function () {
  console.log('redis connect success!');
});
client.on('end', function (err) {
  console.log('end');
});
client.on('error', function (err) {
  console.log('err' + err);
});
client.on('ready', function () {
  console.log('ready');
});

client.connect();


/*client.set("hello", "world", function(err) {
  // This will either result in an error (flush parameter is set to true)
  // or will silently fail and this callback will not be called at all (flush set to false)
  console.error(err);
});*/

module.exports = client;
