resque_ui 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/README.markdown +8 -11
- data/VERSION.yml +1 -1
- data/lib/resque_ui/cap_recipes.rb +4 -4
- data/lib/resque_ui/overrides/resque/worker.rb +1 -1
- data/lib/resque_ui.rb +0 -5
- data/lib/tasks/worker.rake +31 -19
- data/rdoc/Resque/Worker.html +1 -1
- data/rdoc/created.rid +5 -5
- data/rdoc/index.html +3 -3
- data/rdoc/lib/resque_ui/cap_rb.html +1 -1
- data/rdoc/lib/resque_ui/cap_recipes_rb.html +2 -2
- data/rdoc/lib/resque_ui/overrides/resque/job_rb.html +1 -1
- data/rdoc/lib/resque_ui/overrides/resque/resque_rb.html +1 -1
- data/rdoc/lib/resque_ui/overrides/resque/worker_rb.html +2 -2
- data/rdoc/lib/resque_ui/overrides/resque_scheduler/resque_scheduler_rb.html +1 -1
- data/rdoc/lib/resque_ui/overrides/resque_status/chained_job_with_status_rb.html +1 -1
- data/rdoc/lib/resque_ui/overrides/resque_status/job_with_status_rb.html +1 -1
- data/rdoc/lib/resque_ui/overrides/resque_status/status_rb.html +1 -1
- data/rdoc/lib/resque_ui_rb.html +2 -2
- data/resque_ui.gemspec +2 -2
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== 3.1.1 2011-10-13
|
2
|
+
|
3
|
+
* Modified the restart_workers and quit_workers cap tasks to no longer use the , :only => {:resque_restart => true} flag.
|
4
|
+
- These tasks now execute the rake tasks on all servers in the farm
|
5
|
+
* Modified the restart_workers and quit_workers rake tasks to not execute separate cap tasks for each worker.
|
6
|
+
- Task now iterates through the workers and restarts the ones on the box the rake task is executing on.
|
7
|
+
|
1
8
|
== 3.1.0 2011-09-22
|
2
9
|
|
3
10
|
* Added Resque Cleaner to manage the failed queue. Removed the Failed tab.
|
data/README.markdown
CHANGED
@@ -182,10 +182,13 @@ You will also need to tell resque_ui where cap is installed. Add this line to y
|
|
182
182
|
|
183
183
|
The cap tasks included are:
|
184
184
|
|
185
|
-
cap resque:work
|
186
|
-
cap resque:workers
|
187
|
-
cap resque:quit_worker
|
188
|
-
cap resque:
|
185
|
+
cap resque:work # start a resque worker.
|
186
|
+
cap resque:workers # start multiple resque workers.
|
187
|
+
cap resque:quit_worker # Gracefully kill a worker. If the worker is working, it will finish before shutting down.
|
188
|
+
cap resque:quit_workers # Gracefully kill all workers on all servers. If the worker is working, it will finish before shutting down.
|
189
|
+
cap resque:kill_worker_with_impunity # Kill a rogue worker. If the worker is working, it will not finish and the job will go to the Failed queue as a DirtyExit. arg: host=ip pid=pid
|
190
|
+
cap resque:kill_workera_with_impunity # Kill all rogue workers on all servers. If the worker is working, it will not finish and the job will go to the Failed queue as a DirtyExit.
|
191
|
+
cap resque:restart_workers # Restart all workers on all servers
|
189
192
|
|
190
193
|
Multi-Threaded Workers
|
191
194
|
---------------------
|
@@ -211,13 +214,7 @@ After Deploy Hooks
|
|
211
214
|
The resque:restart_workers cap task can be added as an after deploy task to refresh your workers. Without this, your workers will
|
212
215
|
continue to run your old code base after a deployment.
|
213
216
|
|
214
|
-
To make it work:
|
215
|
-
Set one of the servers in your app role as the resque_restart server:
|
216
|
-
|
217
|
-
role :app, "your.first.ip.1","your.second.ip"
|
218
|
-
role :app, "your.first.ip.1", :resque_restart => true
|
219
|
-
|
220
|
-
Then add the callbacks:
|
217
|
+
To make it work add the callbacks in your deploy.rb file:
|
221
218
|
|
222
219
|
after "deploy", "resque:restart_workers"
|
223
220
|
after "deploy:migrations", "resque:restart_workers"
|
data/VERSION.yml
CHANGED
@@ -28,13 +28,13 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
desc "Gracefully kill all workers on all servers. If the worker is working, it will finish before shutting down."
|
31
|
-
task :quit_workers, :roles => :app
|
31
|
+
task :quit_workers, :roles => :app do
|
32
32
|
default_run_options[:pty] = true
|
33
33
|
rake = fetch(:rake, "rake")
|
34
34
|
run("cd #{current_path}; #{rake} RAILS_ENV=#{stage} resque:quit_workers")
|
35
35
|
end
|
36
36
|
|
37
|
-
desc "Kill a rogue worker. If the worker is working, it will not finish and the job will go to the Failed queue as a
|
37
|
+
desc "Kill a rogue worker. If the worker is working, it will not finish and the job will go to the Failed queue as a DirtyExit. arg: host=ip pid=pid"
|
38
38
|
task :kill_worker_with_impunity, :roles => :app do
|
39
39
|
if ENV['host'].nil? || ENV['host'].empty? || ENV['pid'].nil? || ENV['pid'].empty?
|
40
40
|
puts 'You must enter the host and pid to kill..cap resque:quit host=ip pid=pid'
|
@@ -44,7 +44,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
desc "Kill all rogue workers on all servers. If the worker is working, it will not finish and the job will go to the Failed queue as a
|
47
|
+
desc "Kill all rogue workers on all servers. If the worker is working, it will not finish and the job will go to the Failed queue as a DirtyExit.
|
48
48
|
task :kill_workers_with_impunity, :roles => :app do
|
49
49
|
default_run_options[:pty] = true
|
50
50
|
rake = fetch(:rake, "rake")
|
@@ -62,7 +62,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
62
62
|
end
|
63
63
|
|
64
64
|
desc "Restart all workers on all servers"
|
65
|
-
task :restart_workers, :roles => :app
|
65
|
+
task :restart_workers, :roles => :app do
|
66
66
|
default_run_options[:pty] = true
|
67
67
|
rake = fetch(:rake, "rake")
|
68
68
|
run("cd #{current_path}; nohup #{rake} RAILS_ENV=#{stage} resque:restart_workers")
|
@@ -206,7 +206,7 @@ module Resque
|
|
206
206
|
|
207
207
|
def self.start(ips, queues)
|
208
208
|
if Rails.env =~ /development|test/
|
209
|
-
Thread.new(queues) { |queue| system("rake QUEUE=#{queue} resque:work") }
|
209
|
+
Thread.new(queues) { |queue| system("rake RAILS_ENV=#{Rails.env} QUEUE=#{queue} resque:work") }
|
210
210
|
else
|
211
211
|
Thread.new(queues, ips) { |queue, ip_list| system("cd #{Rails.root}; #{ResqueUi::Cap.path} #{Rails.env} resque:work host=#{ip_list} queue=#{queue}") }
|
212
212
|
end
|
data/lib/resque_ui.rb
CHANGED
data/lib/tasks/worker.rake
CHANGED
@@ -4,14 +4,14 @@ namespace :resque do
|
|
4
4
|
task :work => :setup do
|
5
5
|
require 'resque'
|
6
6
|
|
7
|
-
worker
|
8
|
-
queues
|
9
|
-
threads
|
10
|
-
mqueue
|
7
|
+
worker = nil
|
8
|
+
queues = (ENV['QUEUES'] || ENV['QUEUE']).to_s.split('#').delete_if { |a| a.blank? }
|
9
|
+
threads = []
|
10
|
+
mqueue = queues.shift
|
11
11
|
Thread.current[:queues] = mqueue
|
12
|
-
mworker
|
13
|
-
mworker.verbose
|
14
|
-
mworker.very_verbose
|
12
|
+
mworker = Resque::Worker.new(mqueue)
|
13
|
+
mworker.verbose = true #ENV['LOGGING'] || ENV['VERBOSE']
|
14
|
+
mworker.very_verbose = true #ENV['VVERBOSE']
|
15
15
|
|
16
16
|
if ENV['PIDFILE']
|
17
17
|
File.open(ENV['PIDFILE'], 'w') { |f| f << mworker.pid }
|
@@ -21,9 +21,9 @@ namespace :resque do
|
|
21
21
|
threads << Thread.new do
|
22
22
|
begin
|
23
23
|
Thread.current[:queues] = queue
|
24
|
-
worker
|
25
|
-
worker.verbose
|
26
|
-
worker.very_verbose
|
24
|
+
worker = Resque::Worker.new(queue)
|
25
|
+
worker.verbose = ENV['LOGGING'] || ENV['VERBOSE']
|
26
|
+
worker.very_verbose = ENV['VVERBOSE']
|
27
27
|
rescue Resque::NoQueueError
|
28
28
|
abort "set QUEUE env var, e.g. $ QUEUE=critical,high rake resque:work"
|
29
29
|
end
|
@@ -45,10 +45,16 @@ namespace :resque do
|
|
45
45
|
task :restart_workers => :setup do
|
46
46
|
require 'resque'
|
47
47
|
pid = ''
|
48
|
+
queues = ''
|
49
|
+
local_ip = Resque.workers.first.local_ip rescue '';
|
48
50
|
Resque.workers.sort_by { |w| w.to_s }.each do |worker|
|
49
|
-
if
|
50
|
-
worker.
|
51
|
-
|
51
|
+
if local_ip == worker.ip # only restart the workers that are on this server
|
52
|
+
if pid != worker.pid
|
53
|
+
system("kill -INT #{worker.pid}")
|
54
|
+
queues = worker.queues_in_pid.join('#')
|
55
|
+
Thread.new(queues) { |queue| system("nohup rake RAILS_ENV=#{Rails.env} QUEUE=#{queue} resque:work") }
|
56
|
+
pid = worker.pid
|
57
|
+
end
|
52
58
|
end
|
53
59
|
end
|
54
60
|
end
|
@@ -57,10 +63,13 @@ namespace :resque do
|
|
57
63
|
task :quit_workers => :setup do
|
58
64
|
require 'resque'
|
59
65
|
pid = ''
|
66
|
+
local_ip = Resque.workers.first.local_ip
|
60
67
|
Resque.workers.sort_by { |w| w.to_s }.each do |worker|
|
61
|
-
if
|
62
|
-
worker.
|
63
|
-
|
68
|
+
if local_ip == worker.ip # only quit the workers that are on this server
|
69
|
+
if pid != worker.pid
|
70
|
+
system("kill -INT #{worker.pid}")
|
71
|
+
pid = worker.pid
|
72
|
+
end
|
64
73
|
end
|
65
74
|
end
|
66
75
|
end
|
@@ -69,10 +78,13 @@ namespace :resque do
|
|
69
78
|
task :kill_workers_with_impunity => :setup do
|
70
79
|
require 'resque'
|
71
80
|
pid = ''
|
81
|
+
local_ip = Resque.workers.first.local_ip
|
72
82
|
Resque.workers.sort_by { |w| w.to_s }.each do |worker|
|
73
|
-
if
|
74
|
-
|
75
|
-
|
83
|
+
if local_ip == worker.ip # only kill the pids that are on this server
|
84
|
+
if pid != worker.pid # only kill it once
|
85
|
+
`kill -9 #{worker.pid}`
|
86
|
+
pid = worker.pid
|
87
|
+
end
|
76
88
|
end
|
77
89
|
end
|
78
90
|
end
|
data/rdoc/Resque/Worker.html
CHANGED
@@ -212,7 +212,7 @@
|
|
212
212
|
<span class="ruby-comment"># File lib/resque_ui/overrides/resque/worker.rb, line 207</span>
|
213
213
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">start</span>(<span class="ruby-identifier">ips</span>, <span class="ruby-identifier">queues</span>)
|
214
214
|
<span class="ruby-keyword">if</span> <span class="ruby-constant">Rails</span>.<span class="ruby-identifier">env</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/development|test/</span>
|
215
|
-
<span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">queues</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">queue</span><span class="ruby-operator">|</span> <span class="ruby-identifier">system</span>(<span class="ruby-node">"rake QUEUE=#{queue} resque:work"</span>) }
|
215
|
+
<span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">queues</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">queue</span><span class="ruby-operator">|</span> <span class="ruby-identifier">system</span>(<span class="ruby-node">"rake RAILS_ENV=#{Rails.env} QUEUE=#{queue} resque:work"</span>) }
|
216
216
|
<span class="ruby-keyword">else</span>
|
217
217
|
<span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">queues</span>, <span class="ruby-identifier">ips</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">queue</span>, <span class="ruby-identifier">ip_list</span><span class="ruby-operator">|</span> <span class="ruby-identifier">system</span>(<span class="ruby-node">"cd #{Rails.root}; #{ResqueUi::Cap.path} #{Rails.env} resque:work host=#{ip_list} queue=#{queue}"</span>) }
|
218
218
|
<span class="ruby-keyword">end</span>
|
data/rdoc/created.rid
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
Thu,
|
2
|
-
README.markdown Thu,
|
3
|
-
lib/resque_ui.rb Thu,
|
1
|
+
Thu, 13 Oct 2011 12:25:22 -0400
|
2
|
+
README.markdown Thu, 13 Oct 2011 12:23:16 -0400
|
3
|
+
lib/resque_ui.rb Thu, 13 Oct 2011 11:42:34 -0400
|
4
4
|
lib/resque_ui/cap.rb Wed, 14 Sep 2011 16:39:33 -0400
|
5
|
-
lib/resque_ui/cap_recipes.rb
|
5
|
+
lib/resque_ui/cap_recipes.rb Thu, 13 Oct 2011 12:23:16 -0400
|
6
6
|
lib/resque_ui/overrides/resque/job.rb Fri, 16 Sep 2011 14:33:15 -0400
|
7
7
|
lib/resque_ui/overrides/resque/resque.rb Thu, 15 Sep 2011 12:15:57 -0400
|
8
|
-
lib/resque_ui/overrides/resque/worker.rb
|
8
|
+
lib/resque_ui/overrides/resque/worker.rb Tue, 11 Oct 2011 14:29:01 -0400
|
9
9
|
lib/resque_ui/overrides/resque_scheduler/resque_scheduler.rb Thu, 15 Sep 2011 11:57:02 -0400
|
10
10
|
lib/resque_ui/overrides/resque_status/chained_job_with_status.rb Thu, 15 Sep 2011 12:06:19 -0400
|
11
11
|
lib/resque_ui/overrides/resque_status/job_with_status.rb Thu, 15 Sep 2011 12:06:45 -0400
|
data/rdoc/index.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<head>
|
7
7
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
8
8
|
|
9
|
-
<title>ResqueUi 3.1.
|
9
|
+
<title>ResqueUi 3.1.1</title>
|
10
10
|
|
11
11
|
<link type="text/css" media="screen" href="rdoc.css" rel="stylesheet" />
|
12
12
|
|
@@ -19,10 +19,10 @@
|
|
19
19
|
<body class="indexpage">
|
20
20
|
|
21
21
|
|
22
|
-
<h1>ResqueUi 3.1.
|
22
|
+
<h1>ResqueUi 3.1.1</h1>
|
23
23
|
|
24
24
|
|
25
|
-
<p>This is the API documentation for 'ResqueUi 3.1.
|
25
|
+
<p>This is the API documentation for 'ResqueUi 3.1.1'.</p>
|
26
26
|
|
27
27
|
|
28
28
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<head>
|
7
7
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
8
8
|
|
9
|
-
<title>File: cap_recipes.rb [ResqueUi 3.1.
|
9
|
+
<title>File: cap_recipes.rb [ResqueUi 3.1.1]</title>
|
10
10
|
|
11
11
|
<link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet" />
|
12
12
|
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<div id="metadata">
|
25
25
|
<dl>
|
26
26
|
<dt class="modified-date">Last Modified</dt>
|
27
|
-
<dd class="modified-date">
|
27
|
+
<dd class="modified-date">Thu Oct 13 12:23:16 -0400 2011</dd>
|
28
28
|
|
29
29
|
|
30
30
|
<dt class="requires">Requires</dt>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<head>
|
7
7
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
8
8
|
|
9
|
-
<title>File: job.rb [ResqueUi 3.1.
|
9
|
+
<title>File: job.rb [ResqueUi 3.1.1]</title>
|
10
10
|
|
11
11
|
<link type="text/css" media="screen" href="../../../../rdoc.css" rel="stylesheet" />
|
12
12
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<head>
|
7
7
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
8
8
|
|
9
|
-
<title>File: resque.rb [ResqueUi 3.1.
|
9
|
+
<title>File: resque.rb [ResqueUi 3.1.1]</title>
|
10
10
|
|
11
11
|
<link type="text/css" media="screen" href="../../../../rdoc.css" rel="stylesheet" />
|
12
12
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<head>
|
7
7
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
8
8
|
|
9
|
-
<title>File: worker.rb [ResqueUi 3.1.
|
9
|
+
<title>File: worker.rb [ResqueUi 3.1.1]</title>
|
10
10
|
|
11
11
|
<link type="text/css" media="screen" href="../../../../rdoc.css" rel="stylesheet" />
|
12
12
|
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<div id="metadata">
|
25
25
|
<dl>
|
26
26
|
<dt class="modified-date">Last Modified</dt>
|
27
|
-
<dd class="modified-date">
|
27
|
+
<dd class="modified-date">Tue Oct 11 14:29:01 -0400 2011</dd>
|
28
28
|
|
29
29
|
|
30
30
|
<dt class="requires">Requires</dt>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<head>
|
7
7
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
8
8
|
|
9
|
-
<title>File: resque_scheduler.rb [ResqueUi 3.1.
|
9
|
+
<title>File: resque_scheduler.rb [ResqueUi 3.1.1]</title>
|
10
10
|
|
11
11
|
<link type="text/css" media="screen" href="../../../../rdoc.css" rel="stylesheet" />
|
12
12
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<head>
|
7
7
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
8
8
|
|
9
|
-
<title>File: chained_job_with_status.rb [ResqueUi 3.1.
|
9
|
+
<title>File: chained_job_with_status.rb [ResqueUi 3.1.1]</title>
|
10
10
|
|
11
11
|
<link type="text/css" media="screen" href="../../../../rdoc.css" rel="stylesheet" />
|
12
12
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<head>
|
7
7
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
8
8
|
|
9
|
-
<title>File: job_with_status.rb [ResqueUi 3.1.
|
9
|
+
<title>File: job_with_status.rb [ResqueUi 3.1.1]</title>
|
10
10
|
|
11
11
|
<link type="text/css" media="screen" href="../../../../rdoc.css" rel="stylesheet" />
|
12
12
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<head>
|
7
7
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
8
8
|
|
9
|
-
<title>File: status.rb [ResqueUi 3.1.
|
9
|
+
<title>File: status.rb [ResqueUi 3.1.1]</title>
|
10
10
|
|
11
11
|
<link type="text/css" media="screen" href="../../../../rdoc.css" rel="stylesheet" />
|
12
12
|
|
data/rdoc/lib/resque_ui_rb.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<head>
|
7
7
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
8
8
|
|
9
|
-
<title>File: resque_ui.rb [ResqueUi 3.1.
|
9
|
+
<title>File: resque_ui.rb [ResqueUi 3.1.1]</title>
|
10
10
|
|
11
11
|
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet" />
|
12
12
|
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<div id="metadata">
|
25
25
|
<dl>
|
26
26
|
<dt class="modified-date">Last Modified</dt>
|
27
|
-
<dd class="modified-date">Thu
|
27
|
+
<dd class="modified-date">Thu Oct 13 11:42:34 -0400 2011</dd>
|
28
28
|
|
29
29
|
|
30
30
|
<dt class="requires">Requires</dt>
|
data/resque_ui.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{resque_ui}
|
8
|
-
s.version = "3.1.
|
8
|
+
s.version = "3.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kevin Tyll"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-10-13}
|
13
13
|
s.description = %q{A Rails UI for Resque for managing workers, failures and schedules.}
|
14
14
|
s.email = %q{kevintyll@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: resque_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 3.1.
|
5
|
+
version: 3.1.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Kevin Tyll
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-10-13 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|