gresrun / jesque

An implementation of Resque in Java.
http://gresrun.github.io/jesque
Apache License 2.0
628 stars 131 forks source link

Reset to highest priority next queue strategy ignores delayed tasks #126

Closed dvizelman closed 6 years ago

dvizelman commented 7 years ago

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

dvizelman commented 7 years ago

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')
gresrun commented 7 years ago

PRs are welcome!