sidekiq 3.2.3 → 3.2.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sidekiq might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Changes.md +6 -0
- data/lib/sidekiq/extensions/action_mailer.rb +1 -1
- data/lib/sidekiq/middleware/server/retry_jobs.rb +11 -7
- data/lib/sidekiq/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6b396eed600fb9d68a2fb2cfee12ee9ba467fac
|
4
|
+
data.tar.gz: 8effaeb6349a48abe2339611bf57d0d024ed3b61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13dbbabcb09208a493d43b8f8cd6085a2e7ad62171ec831a4413d33797f768fb692d66767a53bf8938850f7df7a1894621ce1d8bd3945795bc8376d258cd5a9c
|
7
|
+
data.tar.gz: 01f0b7d88720d8a44989f17ec4f6f8f2680caa42a496e3e172899f8db5c8a87432617b3d5482b09a6ea78fc85e2c63e5e4928f49a5791a6a7970e48978e5b108
|
data/Changes.md
CHANGED
@@ -14,7 +14,7 @@ module Sidekiq
|
|
14
14
|
|
15
15
|
def perform(yml)
|
16
16
|
(target, method_name, args) = YAML.load(yml)
|
17
|
-
msg = target.
|
17
|
+
msg = target.public_send(method_name, *args)
|
18
18
|
# The email method can return nil, which causes ActionMailer to return
|
19
19
|
# an undeliverable empty message.
|
20
20
|
msg.deliver if msg && (msg.to || msg.cc || msg.bcc) && msg.from
|
@@ -80,6 +80,12 @@ module Sidekiq
|
|
80
80
|
raise Sidekiq::Shutdown if exception_caused_by_shutdown?(e)
|
81
81
|
|
82
82
|
raise e unless msg['retry']
|
83
|
+
attempt_retry(worker, msg, queue, e)
|
84
|
+
end
|
85
|
+
|
86
|
+
private
|
87
|
+
|
88
|
+
def attempt_retry(worker, msg, queue, exception)
|
83
89
|
max_retry_attempts = retry_attempts_from(msg['retry'], @max_retries)
|
84
90
|
|
85
91
|
msg['queue'] = if msg['retry_queue']
|
@@ -90,14 +96,14 @@ module Sidekiq
|
|
90
96
|
|
91
97
|
# App code can stuff all sorts of crazy binary data into the error message
|
92
98
|
# that won't convert to JSON.
|
93
|
-
m =
|
99
|
+
m = exception.message[0..10_000]
|
94
100
|
if m.respond_to?(:scrub!)
|
95
101
|
m.force_encoding("utf-8")
|
96
102
|
m.scrub!
|
97
103
|
end
|
98
104
|
|
99
105
|
msg['error_message'] = m
|
100
|
-
msg['error_class'] =
|
106
|
+
msg['error_class'] = exception.class.name
|
101
107
|
count = if msg['retry_count']
|
102
108
|
msg['retried_at'] = Time.now.to_f
|
103
109
|
msg['retry_count'] += 1
|
@@ -107,11 +113,11 @@ module Sidekiq
|
|
107
113
|
end
|
108
114
|
|
109
115
|
if msg['backtrace'] == true
|
110
|
-
msg['error_backtrace'] =
|
116
|
+
msg['error_backtrace'] = exception.backtrace
|
111
117
|
elsif msg['backtrace'] == false
|
112
118
|
# do nothing
|
113
119
|
elsif msg['backtrace'].to_i != 0
|
114
|
-
msg['error_backtrace'] =
|
120
|
+
msg['error_backtrace'] = exception.backtrace[0..msg['backtrace'].to_i]
|
115
121
|
end
|
116
122
|
|
117
123
|
if count < max_retry_attempts
|
@@ -127,11 +133,9 @@ module Sidekiq
|
|
127
133
|
retries_exhausted(worker, msg)
|
128
134
|
end
|
129
135
|
|
130
|
-
raise
|
136
|
+
raise exception
|
131
137
|
end
|
132
138
|
|
133
|
-
private
|
134
|
-
|
135
139
|
def retries_exhausted(worker, msg)
|
136
140
|
logger.debug { "Dropping message after hitting the retry maximum: #{msg}" }
|
137
141
|
begin
|
data/lib/sidekiq/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Perham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|