Method: Exekutor::Internal::Reserver#earliest_scheduled_at

Defined in:
lib/exekutor/internal/reserver.rb

#earliest_scheduled_atTime?

Gets the earliest scheduled at of all pending jobs in the watched queues

Returns:

  • (Time, nil)

    The earliest scheduled at, or nil if the queues are empty



52
53
54
55
56
# File 'lib/exekutor/internal/reserver.rb', line 52

def earliest_scheduled_at
  jobs = Exekutor::Job.pending
  jobs.where! @reserve_filter_sql unless @reserve_filter_sql.nil?
  jobs.minimum(:scheduled_at)
end