feat: locking and retry in FB message parsing (#7701)

This commit is contained in:
Shivam Mishra
2023-08-23 09:48:17 +07:00
committed by GitHub
parent 18235d3fb5
commit 26ef21a243
8 changed files with 194 additions and 17 deletions

View File

@@ -7,11 +7,12 @@ module Redis::Alfred
# key operations
# set a value in redis
def set(key, value)
$alfred.with { |conn| conn.set(key, value) }
def set(key, value, nx: false, ex: false) # rubocop:disable Naming/MethodParameterName
$alfred.with { |conn| conn.set(key, value, nx: nx, ex: ex) }
end
# set a key with expiry period
# TODO: Deprecate this method, use set with ex: 1.day instead
def setex(key, value, expiry = 1.day)
$alfred.with { |conn| conn.setex(key, expiry, value) }
end
@@ -30,6 +31,10 @@ module Redis::Alfred
$alfred.with { |conn| conn.incr(key) }
end
def exists?(key)
$alfred.with { |conn| conn.exists?(key) }
end
# list operations
def llen(key)