resque 1.10.0 → 1.11.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of resque might be problematic. Click here for more details.

data/HISTORY.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.11.0 (2010-08-23)
2
+
3
+ * Web UI: Group /workers page by hostnames
4
+
1
5
  ## 1.10.0 (2010-08-23)
2
6
 
3
7
  * Support redis:// string format in `Resque.redis=`
@@ -80,6 +80,21 @@ module Resque
80
80
  Array(args).map { |a| a.inspect }.join("\n")
81
81
  end
82
82
 
83
+ def worker_hosts
84
+ @worker_hosts ||= worker_hosts!
85
+ end
86
+
87
+ def worker_hosts!
88
+ hosts = Hash.new { [] }
89
+
90
+ Resque.workers.each do |worker|
91
+ host, _ = worker.to_s.split(':')
92
+ hosts[host] += [worker.to_s]
93
+ end
94
+
95
+ hosts
96
+ end
97
+
83
98
  def partial?
84
99
  @partial
85
100
  end
@@ -1,3 +1,5 @@
1
+ <% @subtabs = worker_hosts.keys.sort unless worker_hosts.size == 1 %>
2
+
1
3
  <% if params[:id] && worker = Resque::Worker.find(params[:id]) %>
2
4
 
3
5
  <h1>Worker <%= worker %></h1>
@@ -34,13 +36,19 @@
34
36
  </tr>
35
37
  </table>
36
38
 
37
- <% elsif params[:id] %>
39
+ <% elsif params[:id] && !worker_hosts.keys.include?(params[:id]) && params[:id] != 'all' %>
38
40
 
39
41
  <h1>Worker doesn't exist</h1>
40
42
 
41
- <% else %>
43
+ <% elsif worker_hosts.size == 1 || params[:id] %>
42
44
 
43
- <h1 class='wi'><%= resque.workers.size %> Workers</h1>
45
+ <% if worker_hosts.size == 1 || params[:id] == 'all' %>
46
+ <% workers = Resque.workers %>
47
+ <% else %>
48
+ <% workers = worker_hosts[params[:id]].map { |id| Resque::Worker.find(id) } %>
49
+ <% end %>
50
+
51
+ <h1 class='wi'><%= workers.size %> Workers</h1>
44
52
  <p class='intro'>The workers listed below are all registered as active on your system.</p>
45
53
  <table class='workers'>
46
54
  <tr>
@@ -49,7 +57,7 @@
49
57
  <th>Queues</th>
50
58
  <th>Processing</th>
51
59
  </tr>
52
- <% for worker in (workers = resque.workers.sort_by { |w| w.to_s }) %>
60
+ <% for worker in (workers = workers.sort_by { |w| w.to_s }) %>
53
61
  <tr class="<%=state = worker.state%>">
54
62
  <td class='icon'><img src="<%=u state %>.png" alt="<%= state %>" title="<%= state %>"></td>
55
63
 
@@ -75,4 +83,27 @@
75
83
  <% end %>
76
84
  </table>
77
85
  <%=poll%>
86
+
87
+ <% else %>
88
+
89
+ <h1 class='wi'>Workers</h1>
90
+ <p class='intro'>The hostnames below all have registered workers. Select a hostname to view its workers, or "all" to see all workers.</p>
91
+ <table class='queues'>
92
+ <tr>
93
+ <th>Hostname</th>
94
+ <th>Workers</th>
95
+ </tr>
96
+ <% for hostname, workers in worker_hosts %>
97
+ <tr>
98
+ <td class='queue'><a class="queue" href="<%= url "workers/#{hostname}" %>"><%= hostname %></a></td>
99
+ <td class='size'><%= workers.size %></td>
100
+ </tr>
101
+ <% end %>
102
+ <tr class="failed">
103
+ <td class='queue failed'><a class="queue" href="<%= url "workers/all" %>">all workers</a></td>
104
+ <td class='size'><%= Resque.workers.size %></td>
105
+ </tr>
106
+ </table>
107
+
108
+
78
109
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module Resque
2
- Version = VERSION = '1.10.0'
2
+ Version = VERSION = '1.11.0'
3
3
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 59
4
5
  prerelease: false
5
6
  segments:
6
7
  - 1
7
- - 10
8
+ - 11
8
9
  - 0
9
- version: 1.10.0
10
+ version: 1.11.0
10
11
  platform: ruby
11
12
  authors:
12
13
  - Chris Wanstrath
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-08-23 00:00:00 -07:00
18
+ date: 2011-02-03 00:00:00 -08:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: redis-namespace
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ~>
26
28
  - !ruby/object:Gem::Version
29
+ hash: 63
27
30
  segments:
28
31
  - 0
29
32
  - 8
@@ -35,9 +38,11 @@ dependencies:
35
38
  name: vegas
36
39
  prerelease: false
37
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
38
42
  requirements:
39
43
  - - ~>
40
44
  - !ruby/object:Gem::Version
45
+ hash: 31
41
46
  segments:
42
47
  - 0
43
48
  - 1
@@ -49,9 +54,11 @@ dependencies:
49
54
  name: sinatra
50
55
  prerelease: false
51
56
  requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
52
58
  requirements:
53
59
  - - ">="
54
60
  - !ruby/object:Gem::Version
61
+ hash: 63
55
62
  segments:
56
63
  - 0
57
64
  - 9
@@ -63,9 +70,11 @@ dependencies:
63
70
  name: json
64
71
  prerelease: false
65
72
  requirement: &id004 !ruby/object:Gem::Requirement
73
+ none: false
66
74
  requirements:
67
75
  - - ~>
68
76
  - !ruby/object:Gem::Version
77
+ hash: 11
69
78
  segments:
70
79
  - 1
71
80
  - 4
@@ -145,23 +154,27 @@ rdoc_options:
145
154
  require_paths:
146
155
  - lib
147
156
  required_ruby_version: !ruby/object:Gem::Requirement
157
+ none: false
148
158
  requirements:
149
159
  - - ">="
150
160
  - !ruby/object:Gem::Version
161
+ hash: 3
151
162
  segments:
152
163
  - 0
153
164
  version: "0"
154
165
  required_rubygems_version: !ruby/object:Gem::Requirement
166
+ none: false
155
167
  requirements:
156
168
  - - ">="
157
169
  - !ruby/object:Gem::Version
170
+ hash: 3
158
171
  segments:
159
172
  - 0
160
173
  version: "0"
161
174
  requirements: []
162
175
 
163
176
  rubyforge_project:
164
- rubygems_version: 1.3.6
177
+ rubygems_version: 1.3.7
165
178
  signing_key:
166
179
  specification_version: 3
167
180
  summary: Resque is a Redis-backed queueing system.