sqewer 8.0.0 → 8.0.1

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
  SHA256:
3
- metadata.gz: 7bef1bf31a141c142252a3ff3a898351808d378f0538197769091fabcfdf7e0e
4
- data.tar.gz: 6eeffee2b8ec4009507ad192aede407c5ab0bb929e694f89f7bf2394ea3f3301
3
+ metadata.gz: db608a0341020c8df0186ebc598164f5efef1c75051b4661aabb6e8c7e5c4406
4
+ data.tar.gz: 3823ade5a67c8e66844eed3e267f5d5c4f0b6f3626c53c645d22ebb57b25ed12
5
5
  SHA512:
6
- metadata.gz: 1b7a6faf35f31cc8fa8f33d063964553308cfef543a2e35c26dccfc55e9819a7754eaff9a77c35233d6e230269f2adc06c8ee23902fda5f41e8c4d0708b6ff02
7
- data.tar.gz: 9aeedcf29cabcb941037df8c51712d908901ab7700c75649ca40986418fc7462ef17218a7431d798cdf43da6ba545b8e3d87bc56735c34e9dac7181579f63560
6
+ metadata.gz: 2c549285412294f21ec5a8af1d5614e949941996c687b91478c5a1ed4553995e888aa56443dde5c6eace899b24d44d5a02e21dfb61d391408e126c01b001e3dd
7
+ data.tar.gz: 49b1d928b6786d38911db7803498a42fd4860c8c7723ec09a477b464103eded17a752d3f900c01f20af5cd0d6d79360d260d78a7636a0a8c1f7e6e322554e209
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ### 8.0.1
2
+ - Release the singleton SQS client when AWS raises credentials error to be able to use a new credential next time
3
+
1
4
  ### 8.0.0
2
5
  - Remove method `Sqewer.client=`
3
6
  - Change `Sqewer::Connection` to use a singleton SQS client by default
@@ -76,6 +76,14 @@ class Sqewer::Connection
76
76
  )
77
77
  response.messages.map {|message| Message.new(message.receipt_handle, message.body, message.attributes) }
78
78
  end
79
+ rescue Aws::Errors::MissingCredentialsError
80
+ # We noticed cases where errors related to AWS credentials started to happen suddenly.
81
+ # We don't know the root cause yet, but what we can do is release the
82
+ # singleton @client instance because it contains a cache of credentials that in most
83
+ # cases is no longer valid.
84
+ self.class.release_client
85
+
86
+ raise
79
87
  end
80
88
 
81
89
  # Send a message to the backing queue
@@ -202,6 +210,12 @@ class Sqewer::Connection
202
210
  buffer.each_batch {|batch| handle_batch_with_retries(:delete_message_batch, batch) }
203
211
  end
204
212
 
213
+ protected
214
+
215
+ def self.release_client
216
+ @client = nil
217
+ end
218
+
205
219
  private
206
220
 
207
221
  def network_and_aws_sdk_errors
@@ -221,5 +235,13 @@ class Sqewer::Connection
221
235
  raise NotOurFaultAwsError
222
236
  end
223
237
  end
238
+ rescue Aws::Errors::MissingCredentialsError
239
+ # We noticed cases where errors related to AWS credentials started to happen suddenly.
240
+ # We don't know the root cause yet, but what we can do is release the
241
+ # singleton @client instance because it contains a cache of credentials that in most
242
+ # cases is no longer valid.
243
+ self.class.release_client
244
+
245
+ raise
224
246
  end
225
247
  end
@@ -1,3 +1,3 @@
1
1
  module Sqewer
2
- VERSION = '8.0.0'
2
+ VERSION = '8.0.1'
3
3
  end
data/sqewer.gemspec CHANGED
@@ -50,4 +50,5 @@ Gem::Specification.new do |spec|
50
50
  spec.add_development_dependency "dotenv"
51
51
  spec.add_development_dependency "simplecov"
52
52
  spec.add_development_dependency "appsignal", '~> 2'
53
+ spec.add_development_dependency "pry-byebug"
53
54
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqewer
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.0
4
+ version: 8.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julik Tarkhanov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-05-26 00:00:00.000000000 Z
12
+ date: 2021-07-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk-sqs
@@ -221,6 +221,20 @@ dependencies:
221
221
  - - "~>"
222
222
  - !ruby/object:Gem::Version
223
223
  version: '2'
224
+ - !ruby/object:Gem::Dependency
225
+ name: pry-byebug
226
+ requirement: !ruby/object:Gem::Requirement
227
+ requirements:
228
+ - - ">="
229
+ - !ruby/object:Gem::Version
230
+ version: '0'
231
+ type: :development
232
+ prerelease: false
233
+ version_requirements: !ruby/object:Gem::Requirement
234
+ requirements:
235
+ - - ">="
236
+ - !ruby/object:Gem::Version
237
+ version: '0'
224
238
  description: A full-featured library for all them SQS worker needs
225
239
  email:
226
240
  - me@julik.nl