Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use sort_by{rand} instead of sort{rand} for randomization as sort{ran…

…d} is of consistent outcome. Thanks Alex Ostleitner.
  • Loading branch information...
commit 9935082b7e6b4eb900ee6830042d0a80543f3a7d 1 parent a99302b
@tobi tobi authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  lib/delayed/job.rb
View
3  lib/delayed/job.rb
@@ -1,4 +1,3 @@
-
module Delayed
class DeserializationError < StandardError
@@ -113,7 +112,7 @@ def self.find_available(limit = 5, max_run_time = MAX_RUN_TIME)
find(:all, :conditions => conditions, :order => NextTaskOrder, :limit => limit)
end
- records.sort { rand() }
+ records.sort_by { rand() }
end
# Get the payload of the next job we can get an exclusive lock on.
Please sign in to comment.
Something went wrong with that request. Please try again.