Skip to content

Commit

Permalink
Add #reload method to reload the payload
Browse files Browse the repository at this point in the history
  • Loading branch information
bryckbost committed Nov 9, 2011
1 parent 4e7d185 commit 7fa745e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/delayed/backend/data_mapper.rb
Expand Up @@ -24,7 +24,6 @@ def self.db_time_now
end

def self.find_available(worker_name, limit = 5, max_run_time = Worker.max_run_time)

simple_conditions = { :run_at.lte => db_time_now, :limit => limit, :failed_at => nil, :order => [:priority.asc, :run_at.asc] }

# respect priorities
Expand Down Expand Up @@ -89,6 +88,11 @@ def update_attributes(attributes)
end
self.save
end

def reload(*args)
reset
super
end
end

class JobObserver
Expand Down

0 comments on commit 7fa745e

Please sign in to comment.