Permalink
Browse files

Use current float time for finding available jobs

  • Loading branch information...
1 parent 782ceb8 commit 757a614d554eac0ba62def40c1af91acddd22042 @bkeepers bkeepers committed Feb 16, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/delayed/backend/mongo.rb
@@ -41,7 +41,7 @@ def self.db_time_now
end
def self.find_available(worker_name, limit = 5, max_run_time = Worker.max_run_time)
- where = "this.run_at <= new Date(#{db_time_now.to_i * 1000}) && (this.locked_at == null || this.locked_at < new Date(#{(db_time_now - max_run_time).to_i * 1000})) || this.locked_by == #{worker_name.to_json}"
+ where = "this.run_at <= new Date(#{db_time_now.to_f * 1000}) && (this.locked_at == null || this.locked_at < new Date(#{(db_time_now - max_run_time).to_f * 1000})) || this.locked_by == #{worker_name.to_json}"
# all(:limit => limit, :failed_at => nil, '$where' => where)
conditions = {

0 comments on commit 757a614

Please sign in to comment.