Skip to content

A platform for community discussion. Free, open, simple.

FIX: Update PresenceChannel#present to work for redis 6.0 (#14180)

David Taylorb47f288b13db
diff --git a/lib/presence_channel.rb b/lib/presence_channel.rb
index 210b0f2c6bf..4ac48f076d3 100644
--- a/lib/presence_channel.rb
+++ b/lib/presence_channel.rb
@@ -484,9 +484,9 @@ class PresenceChannel
added_users = 1
redis.call('SET', mutex_key, mutex_value, 'EX', #{MUTEX_TIMEOUT_SECONDS})
end
- -- Add the channel to the global channel list. 'LT' means the value will
- -- only be set if it's lower than the existing value
- redis.call('ZADD', channels_key, "LT", expires, tostring(channel))
+ -- Add the channel to the global channel list. 'NX' means the value will
+ -- only be set if doesn't already exist
+ redis.call('ZADD', channels_key, "NX", expires, tostring(channel))
end
redis.call('EXPIREAT', hash_key, expires + #{GC_SECONDS})