From 30cb253e857949e3331401bd5768841a4c97050c Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 7 Jan 2022 19:50:12 +0100 Subject: [PATCH] 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 --- streaming/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/streaming/index.js b/streaming/index.js index 5a2111d55495e4..a348711662c696 100644 --- a/streaming/index.js +++ b/streaming/index.js @@ -254,9 +254,10 @@ const startWorker = async (workerId) => { * @param {string} channel * @param {SubscriptionListener} callback */ - const unsubscribe = (channel) => { + const unsubscribe = (channel, callback) => { + log.silly(`Removing listener for ${channel}`); - redisSubscribeClient.unsubscribe(channel); + redisSubscribeClient.unsubscribe(channel, callback); }; const FALSE_VALUES = [