mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
BUGFIX: allow sorting prior to sidekiq starting
This commit is contained in:
parent
f4e3ec905c
commit
de9e1a5049
1 changed files with 9 additions and 1 deletions
|
@ -8,7 +8,15 @@ module Scheduler
|
|||
RailsMultisite::ConnectionManagement.with_connection("default") do
|
||||
@manager = Scheduler::Manager.without_runner
|
||||
@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
|
||||
erb File.read(File.join(VIEWS, 'scheduler.erb')), locals: {view_path: VIEWS}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue