about summary refs log tree commit diff
path: root/streaming
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-01-07 19:50:12 +0100
committerGitHub <noreply@github.com>2022-01-07 19:50:12 +0100
commitbc066d8936e2cfaa2dc275d9a5d4aefc0cbc1d86 (patch)
tree7b9799b06ca62ee53341bbd9ec6b124371dd93c1 /streaming
parente002f323362e63b88eb1ad547335fabd7ab5c843 (diff)
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
Diffstat (limited to 'streaming')
-rw-r--r--streaming/index.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/streaming/index.js b/streaming/index.js
index 74cbf4c2c..47f938b86 100644
--- a/streaming/index.js
+++ b/streaming/index.js
@@ -197,10 +197,12 @@ const startWorker = async (workerId) => {
 
   /**
    * @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 = [