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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56f90dbb4ffba7f12619e992cdd36e92c0c26c90
4
- data.tar.gz: c5a9d6faf0ae1d1aa6b2ecb65b2adc282032a5aa
3
+ metadata.gz: c6b396eed600fb9d68a2fb2cfee12ee9ba467fac
4
+ data.tar.gz: 8effaeb6349a48abe2339611bf57d0d024ed3b61
5
5
  SHA512:
6
- metadata.gz: 730a5cd70e49741c0426ee7f7d467939f72adae0ea276c00cc45cf331e48794fe8c40d1d84c4432c0d92c20bf7f795c06be775c2cae26e98170967673922c302
7
- data.tar.gz: 6261ef3999c2a4ad2674172ce1c84d4bef1fb172c0952994aa0232f943e7671add7c72984f381b3c4a7198a723f72cc3362abc6a81baee136e162992ee63f3b7
6
+ metadata.gz: 13dbbabcb09208a493d43b8f8cd6085a2e7ad62171ec831a4413d33797f768fb692d66767a53bf8938850f7df7a1894621ce1d8bd3945795bc8376d258cd5a9c
7
+ data.tar.gz: 01f0b7d88720d8a44989f17ec4f6f8f2680caa42a496e3e172899f8db5c8a87432617b3d5482b09a6ea78fc85e2c63e5e4928f49a5791a6a7970e48978e5b108
data/Changes.md CHANGED
@@ -1,3 +1,9 @@
1
+ 3.2.4
2
+ -----------
3
+
4
+ - Fix issue preventing ActionMailer sends working in some cases with
5
+ Rails 4. [pbhogan, #1923]
6
+
1
7
  3.2.3
2
8
  -----------
3
9
 
@@ -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.__send__(method_name, *args)
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 = e.message[0..10_000]
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'] = e.class.name
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'] = e.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'] = e.backtrace[0..msg['backtrace'].to_i]
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 e
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
@@ -1,3 +1,3 @@
1
1
  module Sidekiq
2
- VERSION = "3.2.3"
2
+ VERSION = "3.2.4"
3
3
  end
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.3
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-01 00:00:00.000000000 Z
11
+ date: 2014-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis