circuitry 1.2.1 → 1.2.2

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: 7d3cb7574969d248940e91c6fbd01644acde00f1
4
- data.tar.gz: 42d00ec555e5d84515a7715ffb9386336864ed28
3
+ metadata.gz: 256e0d8a13db77008875bc61149ddc8394ddf39d
4
+ data.tar.gz: 913e74856a7c64638aeafa9dbfc7579ac25c5a2a
5
5
  SHA512:
6
- metadata.gz: d14efee260aefebf4b7c0448d67ac318d5b7d3970f4af9e7724342208d054d134ccb315bb9c112d971c7aee8b8df0378e1df715d33e74c6d98c8edc1bea39d38
7
- data.tar.gz: 592e95bbf220f32c9cc5ac0891347b513d8b4f5dee94b17395fe3a07fcba03b2f04a02ff478864944681e894cf0d197a0f283032d7941e3f6808de7b98b8beef
6
+ metadata.gz: 198c0de1c46bdce4af2896d18dbd35c538be86b66e2f5c1196022646e2f0e820d1b0aca685bc300ad5386ac5e26e311232249cc6cd7bab1c2f228f4772589cb8
7
+ data.tar.gz: f915bec849949a21582b2926c9e1ddb383b019e853852fc82051f908c7f0c0cd2c8175a462a2a754fa86211b4c335562a71c91d2d70973bdfbb567e13c76ed2b
@@ -24,6 +24,12 @@ module Circuitry
24
24
  Excon::Errors::Forbidden,
25
25
  ].freeze
26
26
 
27
+ TEMPORARY_ERRORS = [
28
+ Excon::Errors::InternalServerError,
29
+ Excon::Errors::ServiceUnavailable,
30
+ Excon::Errors::Timeout,
31
+ ].freeze
32
+
27
33
  def initialize(queue, options = {})
28
34
  raise ArgumentError.new('queue cannot be nil') if queue.nil?
29
35
 
@@ -81,7 +87,15 @@ module Circuitry
81
87
  private
82
88
 
83
89
  def receive_messages(&block)
84
- response = sqs.receive_message(queue, 'MaxNumberOfMessages' => batch_size, 'WaitTimeSeconds' => wait_time)
90
+ response = nil
91
+
92
+ begin
93
+ response = sqs.receive_message(queue, 'MaxNumberOfMessages' => batch_size, 'WaitTimeSeconds' => wait_time)
94
+ rescue *TEMPORARY_ERRORS => e
95
+ logger.info("Temporary issue connecting to SQS: #{e.message}")
96
+ return
97
+ end
98
+
85
99
  messages = response.body['Message']
86
100
  return if messages.empty?
87
101
 
@@ -1,3 +1,3 @@
1
1
  module Circuitry
2
- VERSION = '1.2.1'
2
+ VERSION = '1.2.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: circuitry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Huggins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-29 00:00:00.000000000 Z
11
+ date: 2015-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-aws