hgetall = async (prefix, pattern, cursor = '0', result = {}) => {
  const newResult = result;
  const reply = await redis.scan(cursor, 'MATCH', pattern, 'COUNT', 1000);

  const replyCursor = reply[0];
  // Retrieve all values

  if (reply[1]) {
    await Promise.all(
      reply[1].map(async replyKey => {
        newResult[replyKey.replace(prefix, '')] = await getWithoutLock(
          replyKey
        );
      })
    );
  }

  if (replyCursor === '0') {
    // no more cursor

    return newResult;
  }

  // has more cursor
  return hgetall(prefix, pattern, replyCursor, newResult);
}
Get value from key

@param {*} prefix
@param {*} pattern
@param {*} cursor
@param {*} result