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
This commit is contained in:
David Taylor 2021-08-27 19:44:28 +01:00 committed by GitHub
parent 01e2836071
commit b47f288b13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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})