参考https://github.com/seomoz/qless ,改进Queue的封装,未完
This commit is contained in:
@@ -2,13 +2,12 @@
|
||||
-- ARGS: [1]currentTime, [2]batchsize, [3]reliable
|
||||
local batchJobs={}
|
||||
for i=1,ARGV[2] do
|
||||
local job=redis.call('rpop', KEYS[1])
|
||||
batchJobs[i]=job
|
||||
batchJobs[i]=redis.call('rpop', KEYS[1])
|
||||
end
|
||||
|
||||
if (ARGV[3]=='true') then
|
||||
for i=1,ARGV[2] do
|
||||
redis.call('zadd', KEYS[2], ARGV[1], batchJobs[i])
|
||||
redis.call('zadd', KEYS[2], ARGV[1], batchJobs[i])
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user