Browse Source

Fix timeline streaming stopping for multiple sessions instead of one (#17259)

* Fix timeline streaming stopping for multiple sessions instead of one

Fixes #17256.

In updating the code for a newer version of node-redis, #17183 also broke
redis subscription management when multiple streaming clients subscribe to the
same channel.

This commit restores the redis subscription management code.

* Let node-redis actually handle the subscriptions
closed-social-glitch-2
Claire 2 years ago
committed by GitHub
parent
commit
bc066d8936
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      streaming/index.js

+ 4
- 2
streaming/index.js View File

@ -197,10 +197,12 @@ const startWorker = async (workerId) => {
/** /**
* @param {string} channel * @param {string} channel
* @param {function(string): void} callback
*/ */
const unsubscribe = (channel) => {
const unsubscribe = (channel, callback) => {
log.silly(`Removing listener for ${channel}`);
redisSubscribeClient.unsubscribe(channel);
redisSubscribeClient.unsubscribe(channel, callback);
}; };
const FALSE_VALUES = [ const FALSE_VALUES = [

Loading…
Cancel
Save