DEV: Update redis gem to 4.8.0 (#19350)

This commit is contained in:
Alan Guo Xiang Tan 2022-12-08 06:48:44 +08:00 committed by GitHub
parent f334de0b4a
commit 773cf045b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 3 deletions

View File

@ -341,7 +341,7 @@ GEM
msgpack (>= 0.4.3) msgpack (>= 0.4.3)
optimist (>= 3.0.0) optimist (>= 3.0.0)
rchardet (1.8.0) rchardet (1.8.0)
redis (4.7.1) redis (4.8.0)
redis-namespace (1.9.0) redis-namespace (1.9.0)
redis (>= 4) redis (>= 4)
regexp_parser (2.6.1) regexp_parser (2.6.1)

View File

@ -50,8 +50,8 @@ class DiscourseRedis
:hdel, :hexists, :hget, :hgetall, :hincrby, :hincrbyfloat, :hkeys, :hlen, :hmget, :hmset, :hset, :hsetnx, :hvals, :incr, :hdel, :hexists, :hget, :hgetall, :hincrby, :hincrbyfloat, :hkeys, :hlen, :hmget, :hmset, :hset, :hsetnx, :hvals, :incr,
:incrby, :incrbyfloat, :lindex, :linsert, :llen, :lpop, :lpush, :lpushx, :lrange, :lrem, :lset, :ltrim, :incrby, :incrbyfloat, :lindex, :linsert, :llen, :lpop, :lpush, :lpushx, :lrange, :lrem, :lset, :ltrim,
:mapped_hmset, :mapped_hmget, :mapped_mget, :mapped_mset, :mapped_msetnx, :move, :mset, :mapped_hmset, :mapped_hmget, :mapped_mget, :mapped_mset, :mapped_msetnx, :move, :mset,
:msetnx, :persist, :pexpire, :pexpireat, :psetex, :pttl, :rename, :renamenx, :rpop, :rpoplpush, :rpush, :rpushx, :sadd, :scard, :msetnx, :persist, :pexpire, :pexpireat, :psetex, :pttl, :rename, :renamenx, :rpop, :rpoplpush, :rpush, :rpushx, :sadd, :sadd?, :scard,
:sdiff, :set, :setbit, :setex, :setnx, :setrange, :sinter, :sismember, :smembers, :sort, :spop, :srandmember, :srem, :strlen, :sdiff, :set, :setbit, :setex, :setnx, :setrange, :sinter, :sismember, :smembers, :sort, :spop, :srandmember, :srem, :srem?, :strlen,
:sunion, :ttl, :type, :watch, :zadd, :zcard, :zcount, :zincrby, :zrange, :zrangebyscore, :zrank, :zrem, :zremrangebyrank, :sunion, :ttl, :type, :watch, :zadd, :zcard, :zcount, :zincrby, :zrange, :zrangebyscore, :zrank, :zrem, :zremrangebyrank,
:zremrangebyscore, :zrevrange, :zrevrangebyscore, :zrevrank, :zrangebyscore, :zremrangebyscore, :zrevrange, :zrevrangebyscore, :zrevrank, :zrangebyscore,
:dump, :restore].each do |m| :dump, :restore].each do |m|

View File

@ -115,6 +115,26 @@ RSpec.describe DiscourseRedis do
end end
end end
describe '#sadd?' do
it "should send the right command with the right key prefix to redis" do
redis = DiscourseRedis.new
redis.without_namespace.expects(:sadd?).with("default:testset", "1", anything)
redis.sadd?("testset", "1")
end
end
describe '#srem?' do
it "should send the right command with the right key prefix to redis" do
redis = DiscourseRedis.new
redis.without_namespace.expects(:srem?).with("default:testset", "1", anything)
redis.srem?("testset", "1")
end
end
describe 'when namespace is disabled' do describe 'when namespace is disabled' do
let(:redis) { DiscourseRedis.new(nil, namespace: false) } let(:redis) { DiscourseRedis.new(nil, namespace: false) }