1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00
mperham--sidekiq/lib
Fernando Seror 63ee43353b JobSet#each goes through elements in descending score order
The current implementation of the #each method uses Redis.zrange to
paginate the iteration and use multiple lightweight calls. It performs
this pagination in descending score order, but each page is returned
from Redis in ascending order. The result is that the final iteration
through the whole set is not sorted properly. Here's an example with a
page of size 3:

Redis set: 1, 2, 3, 4, 5, 6, 7, 8, 9
JobSet.to_a: 7, 8, 9, 4, 5, 6, 1, 2, 3

This fixes it with barely no performance cost (each page is reverted in
Ruby) and all the items are perfectly sorted in descending score order.
2017-11-01 16:12:51 -07:00
..
generators/sidekiq Fix RSpec generated worker template indentation 2017-05-29 10:46:12 -07:00
sidekiq JobSet#each goes through elements in descending score order 2017-11-01 16:12:51 -07:00
sidekiq.rb inline stringify 2017-05-15 14:57:03 -07:00