Refactor code for newer Redis
This commit is contained in:
parent
4c6c81171b
commit
b0bfc290c4
@ -30,8 +30,7 @@ class RemoteStorageAuthorization < ApplicationRecord
|
|||||||
|
|
||||||
def delete_token_from_redis
|
def delete_token_from_redis
|
||||||
key = "rs:authorizations:#{user.address}:#{token}"
|
key = "rs:authorizations:#{user.address}:#{token}"
|
||||||
# You can't delete multiple members of a set with Redis 2
|
redis.srem? key, redis.smembers(key)
|
||||||
redis.smembers(key).each { |auth| redis.srem(key, auth) }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
Loading…
x
Reference in New Issue
Block a user