Skip to content

Commit

Permalink
Fix timeline streaming stopping for multiple sessions instead of one (m…
Browse files Browse the repository at this point in the history
…astodon#17259)

* Fix timeline streaming stopping for multiple sessions instead of one

Fixes mastodon#17256.

In updating the code for a newer version of node-redis, mastodon#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
  • Loading branch information
ClearlyClaire authored and stsecurity committed Oct 17, 2023
1 parent ebd21de commit 30cb253
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions streaming/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit 30cb253

Please sign in to comment.