hermes-rb 0.9.0 → 0.10.0

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: d179bf4ab92b5e5f8e4529c79451fe34a36696cc2bdb5c0397a969e64f77d666
4
- data.tar.gz: 6e967663720dbb15a70ebb5d61ed74821297f443e126b002e72eaf570734fdac
3
+ metadata.gz: 0c4056564cfbc19a2398191265864f5bee9b194e49e3d319581e1739c5a4b5d2
4
+ data.tar.gz: d406ce1ce6ec3573832d605626f84fd3022d8d59506c80f643bbff519c8c6939
5
5
  SHA512:
6
- metadata.gz: f5db736dc76cab7058b37367e4583872d547c77d467cf068496110c376cfbbe4c93f2109b54fdea6766967f902efd87948cd7370a6bb513a838e086012c3c902
7
- data.tar.gz: 9f0276959a27fcb520d1722eee6ee55cc7f85e6e095ec54306c6a1daa8fdd5b7b24e08c3a1ea67fbdd74cabeba3a7500333f5a3e29676d06ab0b13d187085e1c
6
+ metadata.gz: e1390337464e47226954d0a4ec5afb91f542466fdd240c781ee1c61ffb23f888f31447d83ecd5f1bc30f7a2dbfb06f004ca86e589bd54c1d5db2fac74e69233b
7
+ data.tar.gz: e0bfa3aaae3787009defcf124967c89e855980422bd5c323ab2847f9bf35465233b99f8fd0e87d3bced138cea1464e4e86ee47a6ac566ae0130da8b07b1d4158
@@ -9,6 +9,8 @@ jobs:
9
9
  - { ruby: '2.7', rails: '5.2' }
10
10
  - { ruby: '3.0', rails: '6.1' }
11
11
  - { ruby: '3.1', rails: '7.0' }
12
+ - { ruby: '3.3', rails: '7.1' }
13
+ - { ruby: '3.3', rails: '7.2' }
12
14
  runs-on: ubuntu-latest
13
15
  env:
14
16
  BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails.${{ matrix.rails }}.gemfile
@@ -19,7 +21,7 @@ jobs:
19
21
  DD_PROFILING_NO_EXTENSION: true
20
22
  services:
21
23
  postgres:
22
- image: postgres:14
24
+ image: postgres:17
23
25
  env:
24
26
  POSTGRES_USER: postgres
25
27
  POSTGRES_PASSWORD: postgres
data/Appraisals CHANGED
@@ -1,4 +1,4 @@
1
- %w[5.2 6.1 7.0].each do |version|
1
+ %w[5.2 6.1 7.0 7.1 7.2].each do |version|
2
2
  appraise "rails.#{version}" do
3
3
  gem "activesupport", "~> #{version}.0"
4
4
  gem "activerecord", "~> #{version}.0"
data/Changelog.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
 
3
- ## Master
3
+ ## 0.10.0
4
+ - Make scheduling jobs compatible with Sidekiq strict args
5
+
6
+ ## 0.9.1
7
+ - Improve handling database connections when the server kills the connection
4
8
 
5
9
  ## 0.9.0
6
10
  - Handle database reconnection for distributed traces as it might cause some issues with RPCs/synchronous flows
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hermes-rb (0.9.0)
4
+ hermes-rb (0.10.0)
5
5
  activerecord (>= 5)
6
6
  activesupport (>= 5)
7
7
  dry-container (~> 0)
@@ -33,7 +33,7 @@ GEM
33
33
  bundler
34
34
  rake
35
35
  thor (>= 0.14.0)
36
- base64 (0.1.1)
36
+ base64 (0.2.0)
37
37
  bigdecimal (3.1.4)
38
38
  bunny (2.22.0)
39
39
  amq-protocol (~> 2.3, >= 2.3.1)
@@ -42,10 +42,8 @@ GEM
42
42
  json
43
43
  concurrent-ruby (1.2.2)
44
44
  connection_pool (2.4.1)
45
- ddtrace (0.45.0)
46
- msgpack
47
45
  diff-lcs (1.4.4)
48
- drb (2.1.1)
46
+ drb (2.2.0)
49
47
  ruby2_keywords
50
48
  dry-container (0.11.0)
51
49
  concurrent-ruby (~> 1.0)
@@ -78,11 +76,10 @@ GEM
78
76
  ice_nine (0.11.2)
79
77
  json (2.6.3)
80
78
  minitest (5.20.0)
81
- msgpack (1.4.2)
82
79
  multi_json (1.15.0)
83
- mutex_m (0.1.2)
80
+ mutex_m (0.2.0)
84
81
  newrelic_rpm (6.15.0)
85
- pg (1.2.3)
82
+ pg (1.5.9)
86
83
  rack (3.0.8)
87
84
  rake (13.0.1)
88
85
  rbtree (0.4.6)
@@ -108,7 +105,7 @@ GEM
108
105
  set (~> 1.0)
109
106
  thor (1.2.1)
110
107
  timecop (0.9.2)
111
- timeout (0.4.0)
108
+ timeout (0.4.1)
112
109
  tzinfo (2.0.6)
113
110
  concurrent-ruby (~> 1.0)
114
111
  vcr (5.0.0)
@@ -120,7 +117,6 @@ PLATFORMS
120
117
  DEPENDENCIES
121
118
  appraisal
122
119
  bundler
123
- ddtrace
124
120
  hermes-rb!
125
121
  newrelic_rpm
126
122
  pg
@@ -4,6 +4,6 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "activesupport", "~> 6.1.0"
6
6
  gem "activerecord", "~> 6.1.0"
7
- gem "ddtrace", git: "https://github.com/DataDog/dd-trace-rb.git", branch: "master"
7
+ gem "ddtrace", "> 1.0"
8
8
 
9
9
  gemspec path: "../"
@@ -4,6 +4,6 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "activesupport", "~> 7.0.0"
6
6
  gem "activerecord", "~> 7.0.0"
7
- gem "ddtrace", git: "https://github.com/DataDog/dd-trace-rb.git", branch: "master"
7
+ gem "ddtrace", "> 1.0"
8
8
 
9
9
  gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activesupport", "~> 7.1.0"
6
+ gem "activerecord", "~> 7.1.0"
7
+ gem "ddtrace", "> 1.0"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activesupport", "~> 7.2.0"
6
+ gem "activerecord", "~> 7.2.0"
7
+ gem "ddtrace", "> 1.0"
8
+
9
+ gemspec path: "../"
data/hermes-rb.gemspec CHANGED
@@ -41,6 +41,5 @@ Gem::Specification.new do |spec|
41
41
  spec.add_development_dependency "vcr"
42
42
  spec.add_development_dependency "pg"
43
43
  spec.add_development_dependency "newrelic_rpm"
44
- spec.add_development_dependency "ddtrace"
45
44
  spec.add_development_dependency "appraisal"
46
45
  end
@@ -22,11 +22,18 @@ module Hermes
22
22
  registration = config.event_handler.registration_for(event_class)
23
23
 
24
24
  if registration.async?
25
- config.background_processor.public_send(config.enqueue_method, event_class.to_s, body, headers)
25
+ config.background_processor.public_send(
26
+ config.enqueue_method, event_class.to_s, body.stringify_keys, headers.stringify_keys
27
+ )
26
28
  logger.log_enqueued(event_class, body, headers, config.clock.now)
27
29
  else
28
30
  ensure_database_connection!
29
- result = event_processor.call(event_class.to_s, body, headers)
31
+ begin
32
+ result = event_processor.call(event_class.to_s, body, headers)
33
+ rescue StandardError => error
34
+ rescue_from_closed_db_connection(error)
35
+ raise error
36
+ end
30
37
  event = result.event
31
38
  response = result.response
32
39
 
@@ -64,6 +71,13 @@ module Hermes
64
71
  config.database_connection_provider.connection.reconnect! if config.database_connection_provider
65
72
  Hermes::DistributedTrace.connection.reconnect! if config.store_distributed_traces?
66
73
  end
74
+
75
+ def rescue_from_closed_db_connection(error)
76
+ if error.to_s.include?("PG::ConnectionBad")
77
+ config.database_connection_provider.connection_pool.disconnect! if config.database_connection_provider
78
+ Hermes::DistributedTrace.connection_pool.disconnect! if config.store_distributed_traces?
79
+ end
80
+ end
67
81
  end
68
82
 
69
83
  register_consumer(consumer_name, consumer)
@@ -1,5 +1,5 @@
1
1
  module Hermes
2
2
  module Rb
3
- VERSION = "0.9.0"
3
+ VERSION = "0.10.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hermes-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karol Galanciak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-24 00:00:00.000000000 Z
11
+ date: 2024-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct
@@ -192,20 +192,6 @@ dependencies:
192
192
  - - ">="
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
- - !ruby/object:Gem::Dependency
196
- name: ddtrace
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: '0'
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: '0'
209
195
  - !ruby/object:Gem::Dependency
210
196
  name: appraisal
211
197
  requirement: !ruby/object:Gem::Requirement
@@ -246,6 +232,8 @@ files:
246
232
  - gemfiles/rails.5.2.gemfile
247
233
  - gemfiles/rails.6.1.gemfile
248
234
  - gemfiles/rails.7.0.gemfile
235
+ - gemfiles/rails.7.1.gemfile
236
+ - gemfiles/rails.7.2.gemfile
249
237
  - hermes-rb.gemspec
250
238
  - lib/hermes-rb.rb
251
239
  - lib/hermes.rb
@@ -307,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
307
295
  - !ruby/object:Gem::Version
308
296
  version: '0'
309
297
  requirements: []
310
- rubygems_version: 3.1.6
298
+ rubygems_version: 3.5.16
311
299
  signing_key:
312
300
  specification_version: 4
313
301
  summary: A messenger of gods, delivering them via RabbitMQ with a little help from