eventboss 1.1.1 → 1.1.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: 63a1b730db853663d1a26cc59b1935a8176fb9aa0bde0be6e5761499a8127109
4
- data.tar.gz: cae74a3c182b09e6c2a1ee34149388263428ddb3a9db5a8b7058de2d304b8544
3
+ metadata.gz: c2235f89e3779ac82843097dc2b527b3ca2dd10425fe362097d3c90217111ea1
4
+ data.tar.gz: 4606f78b6bdff27c6fe997d71167f7296562aa75ce63c73c725e9eb199d477ae
5
5
  SHA512:
6
- metadata.gz: e52a3a0aafc32e09c275157bfcb9325167be90b8a6ab4cda02ddeccc5577c25e8477c64492751b24b3a1222640ce147a311b01c598500b9f6b1a7a1b67f1b88d
7
- data.tar.gz: d8ade264acf142b682e05ce90a4ca32464f76a301e2e2c0440b4bf52e30d9d22f8ca84f58d02024c48c06c36f726b3b0fc050505f77ab262928f47ae5399cbd5
6
+ metadata.gz: 78dea8a722f457449f18c06b89be6126fcd40a57b2765a884166fc2eff721fe59a2517d9404cce2019018d6ddf500c67598f9cd4edefdf1113743ebb3065fbff
7
+ data.tar.gz: a234ee1da7eaab890ac9ce3e25a0289a45664d393f3a8be25b48c6e5c89b1a91bbe5ba955e9e8f519a701d47e060b683a74af0ebc94ecf24d311eb0c0ab34310
data/Gemfile.lock CHANGED
@@ -1,18 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eventboss (1.1.1)
4
+ eventboss (1.1.2)
5
5
  aws-sdk-sns (>= 1.1.0)
6
6
  aws-sdk-sqs (>= 1.3.0)
7
- concurrent-ruby (~> 1.0, >= 1.0.5)
8
7
  dotenv (~> 2.1, >= 2.1.1)
9
8
 
10
9
  GEM
11
10
  remote: https://rubygems.org/
12
11
  specs:
13
12
  aws-eventstream (1.0.3)
14
- aws-partitions (1.206.0)
15
- aws-sdk-core (3.64.0)
13
+ aws-partitions (1.210.0)
14
+ aws-sdk-core (3.66.0)
16
15
  aws-eventstream (~> 1.0, >= 1.0.2)
17
16
  aws-partitions (~> 1.0)
18
17
  aws-sigv4 (~> 1.1)
@@ -20,12 +19,11 @@ GEM
20
19
  aws-sdk-sns (1.19.0)
21
20
  aws-sdk-core (~> 3, >= 3.61.1)
22
21
  aws-sigv4 (~> 1.1)
23
- aws-sdk-sqs (1.21.0)
22
+ aws-sdk-sqs (1.22.0)
24
23
  aws-sdk-core (~> 3, >= 3.61.1)
25
24
  aws-sigv4 (~> 1.1)
26
25
  aws-sigv4 (1.1.0)
27
26
  aws-eventstream (~> 1.0, >= 1.0.2)
28
- concurrent-ruby (1.1.5)
29
27
  diff-lcs (1.3)
30
28
  dotenv (2.7.5)
31
29
  jmespath (1.4.0)
data/eventboss.gemspec CHANGED
@@ -20,7 +20,6 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = ["eventboss"]
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_dependency "concurrent-ruby", "~> 1.0", ">= 1.0.5"
24
23
  spec.add_dependency "aws-sdk-sqs", ">= 1.3.0"
25
24
  spec.add_dependency "aws-sdk-sns", ">= 1.1.0"
26
25
  spec.add_dependency "dotenv", "~> 2.1", ">= 2.1.1"
@@ -20,7 +20,11 @@ module Eventboss
20
20
  end
21
21
 
22
22
  def error_handlers
23
- defined_or_default('error_handlers') { [ErrorHandlers::Logger.new] }
23
+ defined_or_default('error_handlers') do
24
+ [ErrorHandlers::Logger.new].tap do |handlers|
25
+ handlers << ErrorHandlers::DbConnectionDropHandler.new if defined?(::ActiveRecord::StatementInvalid)
26
+ end
27
+ end
24
28
  end
25
29
 
26
30
  def concurrency
@@ -0,0 +1,11 @@
1
+ module Eventboss
2
+ module ErrorHandlers
3
+ class DbConnectionDropHandler
4
+ def call(exception, _context = {})
5
+ if exception.class == ::ActiveRecord::StatementInvalid
6
+ ::ActiveRecord::Base.clear_active_connections!
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,2 +1,3 @@
1
1
  require 'eventboss/error_handlers/logger'
2
2
  require 'eventboss/error_handlers/airbrake'
3
+ require 'eventboss/error_handlers/db_connection_drop_handler'
@@ -66,7 +66,7 @@ module Eventboss
66
66
  private
67
67
 
68
68
  def worker_count
69
- @options.fetch(:worker_count, [2, Concurrent.processor_count].max)
69
+ @options.fetch(:worker_count, 2)
70
70
  end
71
71
 
72
72
  def new_worker(id)
@@ -1,3 +1,3 @@
1
1
  module Eventboss
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
data/lib/eventboss.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  require 'aws-sdk-sqs'
2
2
  require 'aws-sdk-sns'
3
- require 'concurrent'
4
3
  require 'securerandom'
5
4
 
6
5
  require 'eventboss/version'
metadata CHANGED
@@ -1,35 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventboss
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - AirHelp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-27 00:00:00.000000000 Z
11
+ date: 2019-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: concurrent-ruby
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.0'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 1.0.5
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '1.0'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 1.0.5
33
13
  - !ruby/object:Gem::Dependency
34
14
  name: aws-sdk-sqs
35
15
  requirement: !ruby/object:Gem::Requirement
@@ -143,6 +123,7 @@ files:
143
123
  - lib/eventboss.rb
144
124
  - lib/eventboss/configuration.rb
145
125
  - lib/eventboss/error_handlers/airbrake.rb
126
+ - lib/eventboss/error_handlers/db_connection_drop_handler.rb
146
127
  - lib/eventboss/error_handlers/logger.rb
147
128
  - lib/eventboss/extensions.rb
148
129
  - lib/eventboss/fetcher.rb