From b47f288b13dbdf940055b04b826486cd99552c61 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 27 Aug 2021 19:44:28 +0100 Subject: [PATCH] FIX: Update PresenceChannel#present to work for redis 6.0 (#14180) The `LT` parameter was only added in redis 6.2. We can make do with `NX` instead --- lib/presence_channel.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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})