ElmerFudd 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d82dbca5e1e9fe7636d0fcdd47e0b325e564a170
4
- data.tar.gz: f5c2471a901807d192d2525e08e373cdb58c8d7f
3
+ metadata.gz: e07e344020c0f10d943e0c707fd67ac20e7ffa06
4
+ data.tar.gz: a8e94119bcbf0e3c5a1abb684e0b4e3796c9e355
5
5
  SHA512:
6
- metadata.gz: 344d7e48bbaeab4be0aa8ae373d1b0fd179f90d220faea79b56603c0e05e125919bcdbae66810331e20e535cc40c2ca0b0c3c708bd9fe96fd61b7e6d6010e51d
7
- data.tar.gz: 2b1c3cab0b89d75a5dfa81f54690d7026944f0718c8d09ddf6f673825f9259684f953bdefacee2d6e1ddcc8710708bf6c90c589b5592a4c9330977a76a7836e6
6
+ metadata.gz: 6af150326413a1b669b66300a56bbafb9d63b8eb3db19f45880e17026ff9fdb92f1a6232dca85453573a62bc14efdb9319a48e14293a977a4c1d7b770043e787
7
+ data.tar.gz: 096b0eed055bde27fc76803560fd15eb46a88a0927e590c53a4f5c6c3e935a6f2e9c07521843440dfded6506422c0e47cc070696d3c4fbde1b0cf1d952af6590
@@ -1,3 +1,3 @@
1
1
  module ElmerFudd
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/ElmerFudd.rb CHANGED
@@ -202,15 +202,17 @@ module ElmerFudd
202
202
  extend Filter
203
203
  def self.call(env, message, filters)
204
204
  retry_num = 0
205
- ActiveRecord::Base.connection_pool.with_connection do
206
- call_next(env, message, filters)
207
- end
208
- rescue ActiveRecord::ConnectionTimeoutError
209
- retry_num += 1
210
- if retry_num <= 5
211
- retry
212
- else
213
- raise
205
+ begin
206
+ ActiveRecord::Base.connection_pool.with_connection do
207
+ call_next(env, message, filters)
208
+ end
209
+ rescue ActiveRecord::ConnectionTimeoutError
210
+ retry_num += 1
211
+ if retry_num <= 5
212
+ retry
213
+ else
214
+ raise
215
+ end
214
216
  end
215
217
  end
216
218
  end
@@ -235,14 +237,16 @@ module ElmerFudd
235
237
 
236
238
  def call(env, message, filters)
237
239
  retry_num = 0
238
- call_next(env, message, filters)
239
- rescue @exception => e
240
- if e.message =~ @exception_message_matches && retry_num < @times
241
- retry_num += 1
242
- Math.log(retry_num, 2)
243
- retry
244
- else
245
- raise
240
+ begin
241
+ call_next(env, message, filters)
242
+ rescue @exception => e
243
+ if e.message =~ @exception_message_matches && retry_num < @times
244
+ retry_num += 1
245
+ Math.log(retry_num, 2)
246
+ retry
247
+ else
248
+ raise
249
+ end
246
250
  end
247
251
  end
248
252
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ElmerFudd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrzej Sliwa