mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 22:21:55 +08:00
use symbols in redis proxy methods
This commit is contained in:
parent
2031b69e6e
commit
6018c2f98b
|
@ -43,7 +43,8 @@ class DiscourseRedis
|
||||||
lindex linsert llen lpop lpush lpushx lrange lrem lset ltrim mget move mset msetnx persist pexpire pexpireat psetex
|
lindex linsert llen lpop lpush lpushx lrange lrem lset ltrim mget move mset msetnx persist pexpire pexpireat psetex
|
||||||
pttl rename renamenx rpop rpoplpush rpush rpushx sadd scard sdiff set setbit setex setnx setrange sinter
|
pttl rename renamenx rpop rpoplpush rpush rpushx sadd scard sdiff set setbit setex setnx setrange sinter
|
||||||
sismember smembers sort spop srandmember srem strlen sunion ttl type watch zadd zcard zcount zincrby
|
sismember smembers sort spop srandmember srem strlen sunion ttl type watch zadd zcard zcount zincrby
|
||||||
zrange zrangebyscore zrank zrem zremrangebyrank zremrangebyscore zrevrange zrevrangebyscore zrevrank zrangebyscore).each do |m|
|
zrange zrangebyscore zrank zrem zremrangebyrank zremrangebyscore zrevrange zrevrangebyscore zrevrank zrangebyscore
|
||||||
|
).map(&:to_sym).each do |m|
|
||||||
define_method m do |*args|
|
define_method m do |*args|
|
||||||
args[0] = "#{DiscourseRedis.namespace}:#{args[0]}"
|
args[0] = "#{DiscourseRedis.namespace}:#{args[0]}"
|
||||||
@redis.send(m, *args)
|
@redis.send(m, *args)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user