resque 1.24.1 → 1.25.0.pre
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.
- checksums.yaml +4 -4
- data/HISTORY.md +25 -1
- data/README.markdown +14 -56
- data/lib/resque.rb +47 -5
- data/lib/resque/failure.rb +4 -4
- data/lib/resque/failure/airbrake.rb +20 -4
- data/lib/resque/failure/base.rb +1 -1
- data/lib/resque/failure/redis.rb +15 -4
- data/lib/resque/failure/redis_multi_queue.rb +7 -4
- data/lib/resque/helpers.rb +8 -1
- data/lib/resque/job.rb +120 -3
- data/lib/resque/server.rb +3 -1
- data/lib/resque/server/helpers.rb +6 -2
- data/lib/resque/server/views/failed.erb +2 -1
- data/lib/resque/server/views/layout.erb +2 -2
- data/lib/resque/server/views/next_more.erb +7 -7
- data/lib/resque/stat.rb +5 -1
- data/lib/resque/tasks.rb +1 -1
- data/lib/resque/version.rb +1 -1
- data/lib/resque/worker.rb +119 -35
- data/test/failure_base_test.rb +15 -0
- data/test/test_helper.rb +2 -0
- data/test/worker_test.rb +56 -2
- metadata +49 -52
- data/lib/resque/failure/hoptoad.rb +0 -33
- data/lib/resque/failure/thoughtbot.rb +0 -33
- data/test/dump.rdb +0 -0
- data/test/hoptoad_test.rb +0 -26
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.25.0.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Wanstrath
|
8
|
+
- Steve Klabnik
|
8
9
|
- Terence Lee
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2013-
|
13
|
+
date: 2013-07-23 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: redis-namespace
|
@@ -109,74 +110,71 @@ files:
|
|
109
110
|
- Rakefile
|
110
111
|
- LICENSE
|
111
112
|
- HISTORY.md
|
112
|
-
- lib/resque
|
113
|
-
- lib/
|
114
|
-
- lib/resque
|
115
|
-
- lib/resque/failure/hoptoad.rb
|
116
|
-
- lib/resque/failure/multiple.rb
|
117
|
-
- lib/resque/failure/redis.rb
|
118
|
-
- lib/resque/failure/redis_multi_queue.rb
|
119
|
-
- lib/resque/failure/thoughtbot.rb
|
120
|
-
- lib/resque/failure.rb
|
121
|
-
- lib/resque/helpers.rb
|
122
|
-
- lib/resque/job.rb
|
123
|
-
- lib/resque/log_formatters/quiet_formatter.rb
|
124
|
-
- lib/resque/log_formatters/verbose_formatter.rb
|
125
|
-
- lib/resque/log_formatters/very_verbose_formatter.rb
|
113
|
+
- lib/resque.rb
|
114
|
+
- lib/tasks/redis.rake
|
115
|
+
- lib/tasks/resque.rake
|
126
116
|
- lib/resque/logging.rb
|
127
|
-
- lib/resque/
|
128
|
-
- lib/resque/server/
|
129
|
-
- lib/resque/server/public/favicon.ico
|
130
|
-
- lib/resque/server/public/idle.png
|
131
|
-
- lib/resque/server/public/jquery-1.3.2.min.js
|
117
|
+
- lib/resque/server/test_helper.rb
|
118
|
+
- lib/resque/server/public/working.png
|
132
119
|
- lib/resque/server/public/jquery.relatize_date.js
|
133
|
-
- lib/resque/server/public/poll.png
|
134
120
|
- lib/resque/server/public/ranger.js
|
135
121
|
- lib/resque/server/public/reset.css
|
122
|
+
- lib/resque/server/public/favicon.ico
|
123
|
+
- lib/resque/server/public/poll.png
|
124
|
+
- lib/resque/server/public/jquery-1.3.2.min.js
|
136
125
|
- lib/resque/server/public/style.css
|
137
|
-
- lib/resque/server/public/
|
138
|
-
- lib/resque/server/
|
126
|
+
- lib/resque/server/public/idle.png
|
127
|
+
- lib/resque/server/helpers.rb
|
128
|
+
- lib/resque/server/views/next_more.erb
|
129
|
+
- lib/resque/server/views/stats.erb
|
130
|
+
- lib/resque/server/views/workers.erb
|
131
|
+
- lib/resque/server/views/key_sets.erb
|
139
132
|
- lib/resque/server/views/error.erb
|
140
133
|
- lib/resque/server/views/failed.erb
|
141
|
-
- lib/resque/server/views/
|
134
|
+
- lib/resque/server/views/queues.erb
|
142
135
|
- lib/resque/server/views/failed_queues_overview.erb
|
143
|
-
- lib/resque/server/views/key_sets.erb
|
144
136
|
- lib/resque/server/views/key_string.erb
|
137
|
+
- lib/resque/server/views/failed_job.erb
|
145
138
|
- lib/resque/server/views/layout.erb
|
146
|
-
- lib/resque/server/views/next_more.erb
|
147
139
|
- lib/resque/server/views/overview.erb
|
148
|
-
- lib/resque/server/views/queues.erb
|
149
|
-
- lib/resque/server/views/stats.erb
|
150
|
-
- lib/resque/server/views/workers.erb
|
151
140
|
- lib/resque/server/views/working.erb
|
152
|
-
- lib/resque/server.rb
|
153
141
|
- lib/resque/stat.rb
|
154
|
-
- lib/resque/
|
155
|
-
- lib/resque/
|
142
|
+
- lib/resque/server.rb
|
143
|
+
- lib/resque/errors.rb
|
144
|
+
- lib/resque/version.rb
|
156
145
|
- lib/resque/vendor/utf8_util/utf8_util_19.rb
|
146
|
+
- lib/resque/vendor/utf8_util/utf8_util_18.rb
|
157
147
|
- lib/resque/vendor/utf8_util.rb
|
158
|
-
- lib/resque/
|
148
|
+
- lib/resque/failure/multiple.rb
|
149
|
+
- lib/resque/failure/redis_multi_queue.rb
|
150
|
+
- lib/resque/failure/base.rb
|
151
|
+
- lib/resque/failure/airbrake.rb
|
152
|
+
- lib/resque/failure/redis.rb
|
153
|
+
- lib/resque/helpers.rb
|
159
154
|
- lib/resque/worker.rb
|
160
|
-
- lib/resque.rb
|
161
|
-
- lib/tasks
|
162
|
-
- lib/
|
163
|
-
-
|
155
|
+
- lib/resque/job.rb
|
156
|
+
- lib/resque/tasks.rb
|
157
|
+
- lib/resque/log_formatters/verbose_formatter.rb
|
158
|
+
- lib/resque/log_formatters/very_verbose_formatter.rb
|
159
|
+
- lib/resque/log_formatters/quiet_formatter.rb
|
160
|
+
- lib/resque/failure.rb
|
161
|
+
- lib/resque/plugin.rb
|
164
162
|
- bin/resque-web
|
165
|
-
-
|
166
|
-
- test/
|
167
|
-
- test/hoptoad_test.rb
|
168
|
-
- test/job_hooks_test.rb
|
163
|
+
- bin/resque
|
164
|
+
- test/resque_failure_redis_test.rb
|
169
165
|
- test/job_plugins_test.rb
|
170
|
-
- test/
|
166
|
+
- test/test_helper.rb
|
167
|
+
- test/redis-test.conf
|
171
168
|
- test/plugin_test.rb
|
169
|
+
- test/resque_test.rb
|
172
170
|
- test/redis-test-cluster.conf
|
173
|
-
- test/
|
171
|
+
- test/failure_base_test.rb
|
172
|
+
- test/worker_test.rb
|
173
|
+
- test/job_hooks_test.rb
|
174
174
|
- test/resque-web_test.rb
|
175
|
-
- test/resque_failure_redis_test.rb
|
176
175
|
- test/resque_hook_test.rb
|
177
|
-
- test/
|
178
|
-
- test/
|
179
|
-
- test/worker_test.rb
|
176
|
+
- test/logging_test.rb
|
177
|
+
- test/airbrake_test.rb
|
180
178
|
homepage: http://github.com/defunkt/resque
|
181
179
|
licenses: []
|
182
180
|
metadata: {}
|
@@ -192,14 +190,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
192
190
|
version: '0'
|
193
191
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
194
192
|
requirements:
|
195
|
-
- - '
|
193
|
+
- - '>'
|
196
194
|
- !ruby/object:Gem::Version
|
197
|
-
version:
|
195
|
+
version: 1.3.1
|
198
196
|
requirements: []
|
199
197
|
rubyforge_project:
|
200
|
-
rubygems_version: 2.0.
|
198
|
+
rubygems_version: 2.0.2
|
201
199
|
signing_key:
|
202
200
|
specification_version: 4
|
203
201
|
summary: Resque is a Redis-backed queueing system.
|
204
202
|
test_files: []
|
205
|
-
has_rdoc:
|
@@ -1,33 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require 'hoptoad_notifier'
|
3
|
-
rescue LoadError
|
4
|
-
raise "Can't find 'hoptoad_notifier' gem. Please add it to your Gemfile or install it."
|
5
|
-
end
|
6
|
-
|
7
|
-
require 'resque/failure/thoughtbot'
|
8
|
-
|
9
|
-
module Resque
|
10
|
-
module Failure
|
11
|
-
# A Failure backend that sends exceptions raised by jobs to Hoptoad.
|
12
|
-
#
|
13
|
-
# To use it, put this code in an initializer, Rake task, or wherever:
|
14
|
-
#
|
15
|
-
# require 'resque/failure/hoptoad'
|
16
|
-
#
|
17
|
-
# Resque::Failure::Multiple.classes = [Resque::Failure::Redis, Resque::Failure::Hoptoad]
|
18
|
-
# Resque::Failure.backend = Resque::Failure::Multiple
|
19
|
-
#
|
20
|
-
# Once you've configured resque to use the Hoptoad failure backend,
|
21
|
-
# you'll want to setup an initializer to configure the Hoptoad.
|
22
|
-
#
|
23
|
-
# HoptoadNotifier.configure do |config|
|
24
|
-
# config.api_key = 'your_key_here'
|
25
|
-
# end
|
26
|
-
# For more information see https://github.com/thoughtbot/hoptoad_notifier
|
27
|
-
class Hoptoad < Base
|
28
|
-
include Resque::Failure::Thoughtbot
|
29
|
-
|
30
|
-
@klass = ::HoptoadNotifier
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
module Resque
|
2
|
-
module Failure
|
3
|
-
module Thoughtbot
|
4
|
-
def self.included(base)
|
5
|
-
base.extend(ClassMethods)
|
6
|
-
end
|
7
|
-
|
8
|
-
module ClassMethods
|
9
|
-
attr_accessor :klass
|
10
|
-
|
11
|
-
def configure(&block)
|
12
|
-
Resque::Failure.backend = self
|
13
|
-
klass.configure(&block)
|
14
|
-
end
|
15
|
-
|
16
|
-
def count(queue = nil, class_name = nil)
|
17
|
-
# We can't get the total # of errors from Hoptoad so we fake it
|
18
|
-
# by asking Resque how many errors it has seen.
|
19
|
-
Stat[:failed]
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def save
|
24
|
-
self.class.klass.notify_or_ignore(exception,
|
25
|
-
:parameters => {
|
26
|
-
:payload_class => payload['class'].to_s,
|
27
|
-
:payload_args => payload['args'].inspect
|
28
|
-
}
|
29
|
-
)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
data/test/dump.rdb
DELETED
Binary file
|
data/test/hoptoad_test.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
begin
|
4
|
-
require 'hoptoad_notifier'
|
5
|
-
rescue LoadError
|
6
|
-
warn "Install hoptoad_notifier gem to run Hoptoad tests."
|
7
|
-
end
|
8
|
-
|
9
|
-
if defined? HoptoadNotifier
|
10
|
-
require 'resque/failure/hoptoad'
|
11
|
-
context "Hoptoad" do
|
12
|
-
test "should be notified of an error" do
|
13
|
-
exception = StandardError.new("BOOM")
|
14
|
-
worker = Resque::Worker.new(:test)
|
15
|
-
queue = "test"
|
16
|
-
payload = {'class' => Object, 'args' => 66}
|
17
|
-
|
18
|
-
HoptoadNotifier.expects(:notify_or_ignore).with(
|
19
|
-
exception,
|
20
|
-
:parameters => {:payload_class => 'Object', :payload_args => '66'})
|
21
|
-
|
22
|
-
backend = Resque::Failure::Hoptoad.new(exception, worker, queue, payload)
|
23
|
-
backend.save
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|