BUGFIX: allow sorting prior to sidekiq starting
This commit is contained in:
parent
f4e3ec905c
commit
de9e1a5049
|
@ -8,7 +8,15 @@ module Scheduler
|
||||||
RailsMultisite::ConnectionManagement.with_connection("default") do
|
RailsMultisite::ConnectionManagement.with_connection("default") do
|
||||||
@manager = Scheduler::Manager.without_runner
|
@manager = Scheduler::Manager.without_runner
|
||||||
@schedules = Scheduler::Manager.discover_schedules.sort do |a,b|
|
@schedules = Scheduler::Manager.discover_schedules.sort do |a,b|
|
||||||
a.schedule_info.next_run <=> b.schedule_info.next_run
|
a_next = a.schedule_info.next_run
|
||||||
|
b_next = b.schedule_info.next_run
|
||||||
|
if a_next && b_next
|
||||||
|
a_next <=> b_next
|
||||||
|
elsif a_next
|
||||||
|
-1
|
||||||
|
else
|
||||||
|
1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
erb File.read(File.join(VIEWS, 'scheduler.erb')), locals: {view_path: VIEWS}
|
erb File.read(File.join(VIEWS, 'scheduler.erb')), locals: {view_path: VIEWS}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue