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 27
27
28
28
<% else %>
29
29
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 >
32
38
< p class ='intro '> The list below contains all workers which are currently running a job.</ p >
33
39
< table class ='workers '>
34
40
< tr >
37
43
< th > Queue</ th >
38
44
< th > Processing</ th >
39
45
</ tr >
40
- <% if workers . empty? %>
46
+ <% if worker_jobs . empty? %>
41
47
< tr >
42
48
< td colspan ="4 " class ='no-data '> Nothing is happening right now...</ td >
43
49
</ tr >
44
50
<% end %>
45
51
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 | %>
49
53
< tr >
50
54
< td class ='icon '> < img src ="<%= u state = worker . state %> .png " alt ="<%= state %> " title ="<%= state %> "> </ td >
51
55
<% host , pid , queues = worker . to_s . split ( ':' ) %>
You can’t perform that action at this time.
0 commit comments