feat: Enable reauthorization for Facebook (#1286)
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
# refer : https://redis.io/commands
|
||||
|
||||
module Redis::Alfred
|
||||
include Redis::RedisKeys
|
||||
|
||||
class << self
|
||||
# key operations
|
||||
|
||||
# set a value in redis
|
||||
def set(key, value)
|
||||
$alfred.set(key, value)
|
||||
end
|
||||
|
||||
# set a key with expiry period
|
||||
def setex(key, value, expiry = 1.day)
|
||||
$alfred.setex(key, expiry, value)
|
||||
end
|
||||
@@ -20,6 +24,12 @@ module Redis::Alfred
|
||||
$alfred.del(key)
|
||||
end
|
||||
|
||||
# increment a key by 1. throws error if key value is incompatible
|
||||
# sets key to 0 before operation if key doesn't exist
|
||||
def incr(key)
|
||||
$alfred.incr(key)
|
||||
end
|
||||
|
||||
# list operations
|
||||
|
||||
def llen(key)
|
||||
|
||||
@@ -10,4 +10,8 @@ module Redis::RedisKeys
|
||||
ONLINE_PRESENCE_CONTACTS = 'ONLINE_PRESENCE::%<account_id>d::CONTACTS'.freeze
|
||||
# sorted set storing online presense of account users
|
||||
ONLINE_PRESENCE_USERS = 'ONLINE_PRESENCE::%<account_id>d::USERS'.freeze
|
||||
|
||||
## Authorization Status Keys
|
||||
AUTHORIZATION_ERROR_COUNT = 'AUTHORIZATION_ERROR_COUNT:%<obj_type>s:%<obj_id>d'.freeze
|
||||
REAUTHORIZATION_REQUIRED = 'REAUTHORIZATION_REQUIRED:%<obj_type>s:%<obj_id>d'.freeze
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user