resque 1.12.0 → 1.13.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 +7 -0
- data/LICENSE +1 -1
- data/README.markdown +2 -2
- data/bin/resque +36 -12
- data/lib/resque.rb +1 -1
- data/lib/resque/errors.rb +1 -1
- data/lib/resque/failure.rb +2 -2
- data/lib/resque/server/test_helper.rb +3 -3
- data/lib/resque/server/views/key_sets.erb +0 -1
- data/lib/resque/version.rb +1 -1
- data/lib/resque/worker.rb +1 -1
- data/test/job_hooks_test.rb +0 -1
- data/test/resque-web_test.rb +0 -1
- metadata +8 -8
data/HISTORY.md
CHANGED
data/LICENSE
CHANGED
data/README.markdown
CHANGED
@@ -535,7 +535,7 @@ together. But, it's not that hard.
|
|
535
535
|
Resque Dependencies
|
536
536
|
-------------------
|
537
537
|
|
538
|
-
gem install redis redis-namespace yajl-ruby
|
538
|
+
gem install redis redis-namespace yajl-ruby vegas sinatra
|
539
539
|
|
540
540
|
If you cannot install `yajl-ruby` (JRuby?), you can install the `json`
|
541
541
|
gem and Resque will use it instead.
|
@@ -759,7 +759,7 @@ Once you've made your great commits:
|
|
759
759
|
1. [Fork][1] Resque
|
760
760
|
2. Create a topic branch - `git checkout -b my_branch`
|
761
761
|
3. Push to your branch - `git push origin my_branch`
|
762
|
-
4. Create
|
762
|
+
4. Create a [Pull Request](http://help.github.com/pull-requests/) from your branch
|
763
763
|
5. That's it!
|
764
764
|
|
765
765
|
You might want to checkout our [Contributing][cb] wiki page for information
|
data/bin/resque
CHANGED
@@ -1,7 +1,40 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
|
3
|
+
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
|
4
|
+
begin
|
5
|
+
require 'redis-namespace'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'redis-namespace'
|
9
|
+
end
|
4
10
|
require 'resque'
|
11
|
+
require 'optparse'
|
12
|
+
|
13
|
+
parser = OptionParser.new do |opts|
|
14
|
+
opts.banner = "Usage: resque [options] COMMAND"
|
15
|
+
|
16
|
+
opts.separator ""
|
17
|
+
opts.separator "Options:"
|
18
|
+
|
19
|
+
opts.on("-r", "--redis [HOST:PORT]", "Redis connection string") do |host|
|
20
|
+
Resque.redis = host
|
21
|
+
end
|
22
|
+
|
23
|
+
opts.on("-N", "--namespace [NAMESPACE]", "Redis namespace") do |namespace|
|
24
|
+
Resque.redis.namespace = namespace
|
25
|
+
end
|
26
|
+
|
27
|
+
opts.on("-h", "--help", "Show this message") do
|
28
|
+
puts opts
|
29
|
+
exit
|
30
|
+
end
|
31
|
+
|
32
|
+
opts.separator ""
|
33
|
+
opts.separator "Commands:"
|
34
|
+
opts.separator " remove WORKER Removes a worker"
|
35
|
+
opts.separator " kill WORKER Kills a worker"
|
36
|
+
opts.separator " list Lists known workers"
|
37
|
+
end
|
5
38
|
|
6
39
|
def kill(worker)
|
7
40
|
abort "** resque kill WORKER_ID" if worker.nil?
|
@@ -34,11 +67,7 @@ def list
|
|
34
67
|
end
|
35
68
|
end
|
36
69
|
|
37
|
-
|
38
|
-
Resque.redis = ARGV[i+1]
|
39
|
-
ARGV.delete_at(i)
|
40
|
-
ARGV.delete_at(i+1)
|
41
|
-
end
|
70
|
+
parser.parse!
|
42
71
|
|
43
72
|
case ARGV[0]
|
44
73
|
when 'kill'
|
@@ -48,10 +77,5 @@ when 'remove'
|
|
48
77
|
when 'list'
|
49
78
|
list
|
50
79
|
else
|
51
|
-
puts
|
52
|
-
puts
|
53
|
-
puts "Commands:"
|
54
|
-
puts " remove WORKER Removes a worker"
|
55
|
-
puts " kill WORKER Kills a worker"
|
56
|
-
puts " list Lists known workers"
|
80
|
+
puts parser.help
|
57
81
|
end
|
data/lib/resque.rb
CHANGED
@@ -33,7 +33,7 @@ module Resque
|
|
33
33
|
def redis=(server)
|
34
34
|
if server.respond_to? :split
|
35
35
|
if server =~ /redis\:\/\//
|
36
|
-
redis = Redis.connect(:url => server)
|
36
|
+
redis = Redis.connect(:url => server, :thread_safe => true)
|
37
37
|
else
|
38
38
|
server, namespace = server.split('/', 2)
|
39
39
|
host, port, db = server.split(':')
|
data/lib/resque/errors.rb
CHANGED
data/lib/resque/failure.rb
CHANGED
@@ -5,15 +5,15 @@ module Resque
|
|
5
5
|
module TestHelper
|
6
6
|
class Test::Unit::TestCase
|
7
7
|
include Rack::Test::Methods
|
8
|
-
def app
|
8
|
+
def app
|
9
9
|
Resque::Server.new
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.should_respond_with_success
|
13
13
|
test "should respond with success" do
|
14
14
|
assert last_response.ok?, last_response.errors
|
15
|
-
end
|
16
|
-
end
|
15
|
+
end
|
16
|
+
end
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
data/lib/resque/version.rb
CHANGED
data/lib/resque/worker.rb
CHANGED
@@ -470,7 +470,7 @@ module Resque
|
|
470
470
|
# Returns an array of string pids of all the other workers on this
|
471
471
|
# machine. Useful when pruning dead workers on startup.
|
472
472
|
def worker_pids
|
473
|
-
`ps -A -o pid,command | grep [r]esque | grep -
|
473
|
+
`ps -A -o pid,command | grep [r]esque | grep -v "resque-web"`.split("\n").map do |line|
|
474
474
|
line.split(' ')[0]
|
475
475
|
end
|
476
476
|
end
|
data/test/job_hooks_test.rb
CHANGED
data/test/resque-web_test.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 35
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
8
|
+
- 13
|
9
9
|
- 0
|
10
|
-
version: 1.
|
10
|
+
version: 1.13.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chris Wanstrath
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-07 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -24,14 +24,14 @@ dependencies:
|
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 55
|
30
30
|
segments:
|
31
31
|
- 0
|
32
|
-
-
|
32
|
+
- 10
|
33
33
|
- 0
|
34
|
-
version: 0.
|
34
|
+
version: 0.10.0
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|