Skip to content

Commit

Permalink
Do not store key in local var in redis schedule pop lua script.
Browse files Browse the repository at this point in the history
This causes problems with some bullshit that redis cluster is doing.
Fixes #632
  • Loading branch information
coleifer committed Nov 9, 2021
1 parent 6185c6e commit 3ce5e6d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions huey/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,9 @@ def flush_results(self):
# and atomically pop them from the sorted set and return them. It won't return
# anything if it isn't able to remove the items it reads.
SCHEDULE_POP_LUA = """\
local key = KEYS[1]
local unix_ts = ARGV[1]
local res = redis.call('zrangebyscore', key, '-inf', unix_ts)
if #res and redis.call('zremrangebyscore', key, '-inf', unix_ts) == #res then
local res = redis.call('zrangebyscore', KEYS[1], '-inf', unix_ts)
if #res and redis.call('zremrangebyscore', KEYS[1], '-inf', unix_ts) == #res then
return res
end"""

Expand Down

0 comments on commit 3ce5e6d

Please sign in to comment.