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 +4 -4
- data/lib/circuitry/subscriber.rb +15 -1
- data/lib/circuitry/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: 256e0d8a13db77008875bc61149ddc8394ddf39d
|
4
|
+
data.tar.gz: 913e74856a7c64638aeafa9dbfc7579ac25c5a2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 198c0de1c46bdce4af2896d18dbd35c538be86b66e2f5c1196022646e2f0e820d1b0aca685bc300ad5386ac5e26e311232249cc6cd7bab1c2f228f4772589cb8
|
7
|
+
data.tar.gz: f915bec849949a21582b2926c9e1ddb383b019e853852fc82051f908c7f0c0cd2c8175a462a2a754fa86211b4c335562a71c91d2d70973bdfbb567e13c76ed2b
|
data/lib/circuitry/subscriber.rb
CHANGED
@@ -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 =
|
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
|
|
data/lib/circuitry/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-aws
|