我在本地桌面或远程测试服务器上使用redis服务器 .

我想在redis服务器上不存在时设置密钥 .

所以我检查密钥存在如下代码

连接功能

let pool;

// Redis Connect
export const connect = async () => {
  try {
    if (!pool) {
      pool = await redis.createClient({
        host: RedisConf.connect.name,
        port: RedisConf.connect.port,
        db: 0
      });
    }
  } catch (err) {
    console.log(`Redis Connect Error - ${err}`);
  }
  return pool;
};

存在功能

export const exists = async pKey => {
  const rds = await connect();
  let existsResult;
  try {
    existsResult = await rds.exists(pKey);
    console.log(existsResult);
  } catch (err) {
    console.log(`Exists Command Error - `, err);
  }
  return existsResult;
};

### using above code on my custom middleware module
// is write in side of async function
 const redisKey = `${RedisConf.keyName.app}:${authKey}`;
    // Check Is In Redis Server
    let isRedisExists = await RedisUtil.exists(redisKey);
    isRedisExists = Boolean(isRedisExists);
    console.log(`isRedisExists => ${isRedisExists} => ${!isRedisExists}`);
    try {
      if (!isRedisExists) {
        console.log(`redis Set Process => start`);
        // Do something
      ]
    }catch(err){
    // Do something
   }

github问题:https://github.com/NodeRedis/node_redis/issues/1400#issue-389113321

我怎样才能解决上述问题?