mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-13 07:27:43 +00:00
set the key only if it doesn't exist, otherwise it will never expire
This commit is contained in:
parent
fb9741f7e0
commit
961e41094d
1 changed files with 1 additions and 1 deletions
|
@ -197,9 +197,9 @@ func enqueueAccounts(ctx context.Context, logger *logrus.Logger, statsd *statsd.
|
|||
for i=1, #ids do
|
||||
local key = "locks:accounts:" .. ids[i]
|
||||
if redis.call("exists", key) == 0 then
|
||||
redis.call("setex", key, 60, 1)
|
||||
retv[#retv + 1] = ids[i]
|
||||
end
|
||||
redis.call("setex", key, 60, 1)
|
||||
end
|
||||
|
||||
return retv
|
||||
|
|
Loading…
Reference in a new issue