Sort schedules by "next run due" time

This commit is contained in:
Sam 2014-02-06 10:59:25 +11:00
parent 14018ec07c
commit fad80bbee3
1 changed files with 3 additions and 1 deletions

View File

@ -5,8 +5,10 @@ module Scheduler
def self.registered(app)
app.get "/scheduler" do
@schedules = Scheduler::Manager.discover_schedules
@manager = Scheduler::Manager.without_runner
@schedules = Scheduler::Manager.discover_schedules.sort do |a,b|
a.schedule_info.next_run <=> b.schedule_info.next_run
end
erb File.read(File.join(VIEWS, 'scheduler.erb')), locals: {view_path: VIEWS}
end