You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Fix monitor mode not working with IPv6, sockets or lua scripts
Fixes #1189 Fixes #1037
This commit is contained in:
6
index.js
6
index.js
@@ -791,9 +791,6 @@ function return_pub_sub (self, reply) {
|
||||
}
|
||||
|
||||
RedisClient.prototype.return_reply = function (reply) {
|
||||
// If in monitor mode, all normal commands are still working and we only want to emit the streamlined commands
|
||||
// As this is not the average use case and monitor is expensive anyway, let's change the code here, to improve
|
||||
// the average performance of all other commands in case of no monitor mode
|
||||
if (this.monitoring) {
|
||||
var replyStr;
|
||||
if (this.buffers && Buffer.isBuffer(reply)) {
|
||||
@@ -801,8 +798,7 @@ RedisClient.prototype.return_reply = function (reply) {
|
||||
} else {
|
||||
replyStr = reply;
|
||||
}
|
||||
// While reconnecting the redis server does not recognize the client as in monitor mode anymore
|
||||
// Therefore the monitor command has to finish before it catches further commands
|
||||
// If in monitor mode, all normal commands are still working and we only want to emit the streamlined commands
|
||||
if (typeof replyStr === 'string' && utils.monitor_regex.test(replyStr)) {
|
||||
var timestamp = replyStr.slice(0, replyStr.indexOf(' '));
|
||||
var args = replyStr.slice(replyStr.indexOf('"') + 1, -1).split('" "').map(function (elem) {
|
||||
|
Reference in New Issue
Block a user