You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Crashes node-redis. In theory if the channel is already unsubscribed redis should not try to unsubscribe it again (If I understand why the error happens)
Great job btw :) Thank you!
The text was updated successfully, but these errors were encountered:
I'm working on an application to notify realtime variables (temperature/humidity,etc) to web-browser clients, using node/socket.io/redis.
At my node code I've the following lines:
cliSocket.on('subscribe',function(msg)
{
console.log("Subscription request:"+msg.channel);
// Only one subscription allowed per client
redisCli.punsubscribe("*");
// Subscribe to new channel
redisCli.subscribe(msg.channel);
});
Test steps:
Start node server with the depicted code....
Open a browser and connect to the node server
Browser sends a "subscribe" command using socket.io
Redis_cli crashes.
The problem is this line: redisCli.punsubscribe("*"); if I comment out this line, it no longer crashes.
To prevent this from crashing redis, add the following. The command state queue error is caused by the double unsubscribe (or trying to unsubscribe when you are not subscribed to anything, in @jsolla's case?). Not really sure if there's a good way to fix this in node_redis, if either of you would like to submit pull requests, I would be happy to look them over and most-likely merge.
Hello,
Using this snippet:
Crashes node-redis. In theory if the channel is already unsubscribed redis should not try to unsubscribe it again (If I understand why the error happens)
Great job btw :) Thank you!
The text was updated successfully, but these errors were encountered: