Unhandled rejection RangeError: Using transaction with a client that is in monitor mode does not work due to faulty return values of Redis

Unhandled rejection RangeError: Using transaction with a client that is in monitor mode does not work due to faulty return values of Redis

似乎是一个有效的问题,

我正在使用库 node-redis 为 Node.JS 执行多原子事务,在我的 IBM Bluemix 日志结果中,我收到以下错误:

Unhandled rejection RangeError: Using transaction with a client that is in monitor mode does not work due to faulty return values of Redis.

现在是有趣的部分,错误被精确定位到我的脚本中的第 255 行:

 /* Code Above */
 //
 //
 //
 new Promise((resolve, reject)=>{


   [LINE 255] client.multi().hget(practitioner, "texted").hget(practitioner, "replied")
                .execAsync().then((replies)=>{
                  console.log(replies);
                  var _replied = replies[1],
                      _texted = replies[0];
                  if (_replied && _texted){
                    retrievalSuccess = `Practitioner ${practitioner} has sent a message to the NOK participant
                                        \s ${contact.fname} ${contact.lname} at ${TimeStamper()},
                                        \s participant returned SMS of OK
                                        \s, closing..."`;
                    console.info(retrievalSuccess);
                    auditFile.message += "\n"+retrievalSuccess;

               /* rest of the code */

我的路线没有抛出任何错误 UNTIL 我将这段代码添加到回调中

 client.monitor((err, res)=>{
   console.log("Entering monitoring mode.", res);
 });

  client.on("monitor", (time, args, raw_reply)=>{
    console.log(time + ": " + args); // 1458910076.446514:['set', 'foo', 'bar']
  });

监控功能是否无法处理服务器上的两个事务?我仍然能够在此语句之前执行 .exec() 提交,我不确定 execAsync 是否是我无法接收日志语句并中断运行时的根本原因。

每个 Redis 节点:

The monitor client may not fire any other commands than quit after activating monitor. You have to open a new client and then fire the commands with that one instead. The monitor client is going to receive everything that is happening with the other client.