gresrun / jesque

An implementation of Resque in Java.

Home Page:http://gresrun.github.io/jesque

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reset to highest priority next queue strategy ignores delayed tasks

dvizelman opened this issue · comments

When workers are defined to use RESET_TO_HIGHEST_PRIORITY next queue strategy, they are suddenly stop to recognize delayed tasks and execute all the tasks as immediate tasks

I've checked the issue and it appears that issue can be easily fixed by introducing small changes in WorkerImpl.java and workerScripts/fromMultiplePriorityQueues.lua:

WorkerImpl.java , pop():

    add Long.toString(System.currentTimeMillis() parameter to evalsha

workerScripts/fromMultiplePriorityQueues.lua:

   local now = ARGV[1]
   local firstMsg = redis.call('ZRANGEBYSCORE', queueName, '-inf', now, 'WITHSCORES', 'LIMIT' , '0' , '1')

PRs are welcome!