pheme 3.3.0 → 3.3.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
  SHA256:
3
- metadata.gz: 290bb6b78fadf5e1dbd173c9c8bc1a6cd2cbd31f5d9058714ce4f2f77085cec7
4
- data.tar.gz: f176ebff0f18a9cf36fade1cf6c169ad2c606116719d9cf206089c4d86a0553a
3
+ metadata.gz: 62d4b2ba0e79681e04b9069a54b4132facee47ce50e5fa3f9fa0f4ac6f3b5dd0
4
+ data.tar.gz: 56159e0007559116b2ca486e1f73f3a209b79aa7d4ce3a746ff953e100853be0
5
5
  SHA512:
6
- metadata.gz: 9ae6f12316cf6a777935078f322829b163603a2423672d8ef6b18ce4c0c64575cd66b22e218fc442547b34c25a8d6f9e9e6bc1b36fa6d97e45b48f5c29a78d4a
7
- data.tar.gz: 8e35c281558aa4e72a9cfaf96cfe35f7d33929ccb61cf98ee48c21befd27587c2c7d31416e65a92c900f3bac4221511d5f039fe53e1c5cfafccbf27d85967a16
6
+ metadata.gz: 046d1c5e5119bc35bc47d721a728e45840275790891bd5f4aa474f335b1d9fb456462c07a1b349ec71cc4f6c55a61fb65ae21bf5d2fd8bf7f51aadb842ee97c7
7
+ data.tar.gz: b6e6dcb3d819c50999cbfc89d941c5046f7dfabcb63004f780bdc2d53c198246483eaf2985340b3a7514eb3fa6d21f81950e5febfcff923350fe15527668d09c
@@ -53,23 +53,21 @@ module Pheme
53
53
 
54
54
  def poll
55
55
  time_start = log_polling_start
56
- with_optional_connection_pool_block do
57
- queue_poller.poll(poller_configuration) do |queue_message|
58
- @messages_received += 1
59
- Pheme.logger.tagged(queue_message.message_id) do
60
- begin
61
- content = parse_body(queue_message)
62
- metadata = parse_metadata(queue_message)
63
- handle(content, metadata)
64
- queue_poller.delete_message(queue_message)
65
- log_delete(queue_message)
66
- @messages_processed += 1
67
- rescue SignalException
68
- throw :stop_polling
69
- rescue StandardError => e
70
- Pheme.logger.error(e)
71
- Pheme.rollbar(e, "#{self.class} failed to process message", { message: content })
72
- end
56
+ queue_poller.poll(poller_configuration) do |queue_message|
57
+ @messages_received += 1
58
+ Pheme.logger.tagged(queue_message.message_id) do
59
+ begin
60
+ content = parse_body(queue_message)
61
+ metadata = parse_metadata(queue_message)
62
+ with_optional_connection_pool_block { handle(content, metadata) }
63
+ queue_poller.delete_message(queue_message)
64
+ log_delete(queue_message)
65
+ @messages_processed += 1
66
+ rescue SignalException
67
+ throw :stop_polling
68
+ rescue StandardError => e
69
+ Pheme.logger.error(e)
70
+ Pheme.rollbar(e, "#{self.class} failed to process message", { message: content })
73
71
  end
74
72
  end
75
73
  end
@@ -1,3 +1,3 @@
1
1
  module Pheme
2
- VERSION = '3.3.0'.freeze
2
+ VERSION = '3.3.2'.freeze
3
3
  end
@@ -25,7 +25,7 @@ describe Pheme do
25
25
  describe '.validate!' do
26
26
  subject { configuration.validate! }
27
27
 
28
- let(:configuration) { Pheme::Configuration.new }
28
+ let(:configuration) { described_class.new }
29
29
 
30
30
  context 'empty configuration' do
31
31
  it 'is invalid when empty' do
@@ -1,10 +1,4 @@
1
1
  describe Pheme::MessageType::SnsMessage do
2
- module SnsMessage
3
- class Fixture < ExampleQueuePoller
4
- include Pheme::MessageType::SnsMessage
5
- end
6
- end
7
-
8
2
  subject { SnsMessage::Fixture.new }
9
3
 
10
4
  let(:poller) do
@@ -16,6 +10,12 @@ describe Pheme::MessageType::SnsMessage do
16
10
  end
17
11
 
18
12
  before do
13
+ test_class = Class.new(ExampleQueuePoller) do
14
+ include Pheme::MessageType::SnsMessage
15
+ end
16
+
17
+ stub_const('SnsMessage::Fixture', test_class)
18
+
19
19
  use_default_configuration!
20
20
  allow(Aws::SQS::QueuePoller).to receive(:new) { poller }
21
21
  end
@@ -201,11 +201,11 @@ describe Pheme::QueuePoller do
201
201
 
202
202
  describe "#poll" do
203
203
  before do
204
- module ActiveRecord
205
- class Base
206
- def self.connection_pool; end
207
- end
204
+ active_record_stub = Class.new do
205
+ def connection_pool; end
208
206
  end
207
+
208
+ stub_const('ActiveRecord::Base', active_record_stub)
209
209
  end
210
210
 
211
211
  context "with connection pool block" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pheme
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Graham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-09 00:00:00.000000000 Z
11
+ date: 2019-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport