File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 2727
2828<% else %>
2929
30- <% workers = resque . working . reject { |w | w . idle? } %>
31- < h1 class ='wi '> <%= workers . size %> of <%= resque . workers . size %> Workers Working</ h1 >
30+ <%
31+ workers = resque . working
32+ jobs = workers . collect { |w | w . job }
33+ worker_jobs = workers . zip ( jobs )
34+ worker_jobs = worker_jobs . reject { |w , j | w . idle? }
35+ %>
36+
37+ < h1 class ='wi '> <%= worker_jobs . size %> of <%= resque . workers . size %> Workers Working</ h1 >
3238 < p class ='intro '> The list below contains all workers which are currently running a job.</ p >
3339 < table class ='workers '>
3440 < tr >
3743 < th > Queue</ th >
3844 < th > Processing</ th >
3945 </ tr >
40- <% if workers . empty? %>
46+ <% if worker_jobs . empty? %>
4147 < tr >
4248 < td colspan ="4 " class ='no-data '> Nothing is happening right now...</ td >
4349 </ tr >
4450 <% end %>
4551
46- <% for worker in workers . sort_by { |w | w . job [ 'run_at' ] ? w . job [ 'run_at' ] : '' } %>
47- <% job = worker . job %>
48-
52+ <% worker_jobs . sort_by { |w , j | j [ 'run_at' ] ? j [ 'run_at' ] : '' } . each do |worker , job | %>
4953 < tr >
5054 < td class ='icon '> < img src ="<%= u state = worker . state %> .png " alt ="<%= state %> " title ="<%= state %> "> </ td >
5155 <% host , pid , queues = worker . to_s . split ( ':' ) %>
You can’t perform that action at this time.
0 commit comments