Class: Delayed::Master::JobFinder
- Inherits:
-
Object
- Object
- Delayed::Master::JobFinder
- Defined in:
- lib/delayed/master/job_finder.rb
Instance Method Summary collapse
-
#initialize(master) ⇒ JobFinder
constructor
A new instance of JobFinder.
- #ready_jobs(database, setting, limit) ⇒ Object
- #recent_jobs(database) ⇒ Object
Constructor Details
#initialize(master) ⇒ JobFinder
Returns a new instance of JobFinder.
10 11 12 |
# File 'lib/delayed/master/job_finder.rb', line 10 def initialize(master) @config = master.config end |
Instance Method Details
#ready_jobs(database, setting, limit) ⇒ Object
14 15 16 17 18 |
# File 'lib/delayed/master/job_finder.rb', line 14 def ready_jobs(database, setting, limit) ready_scope(database, setting).limit(limit).pluck(:id, :run_at).map do |id, run_at| Job.new(database: database, setting: setting, id: id, run_at: run_at) end end |