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 +4 -4
- data/.github/workflows/ci.yml +3 -1
- data/Appraisals +1 -1
- data/Changelog.md +5 -1
- data/Gemfile.lock +6 -10
- data/gemfiles/rails.6.1.gemfile +1 -1
- data/gemfiles/rails.7.0.gemfile +1 -1
- data/gemfiles/rails.7.1.gemfile +9 -0
- data/gemfiles/rails.7.2.gemfile +9 -0
- data/hermes-rb.gemspec +0 -1
- data/lib/hermes/consumer_builder.rb +16 -2
- data/lib/hermes/rb/version.rb +1 -1
- metadata +5 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c4056564cfbc19a2398191265864f5bee9b194e49e3d319581e1739c5a4b5d2
|
4
|
+
data.tar.gz: d406ce1ce6ec3573832d605626f84fd3022d8d59506c80f643bbff519c8c6939
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1390337464e47226954d0a4ec5afb91f542466fdd240c781ee1c61ffb23f888f31447d83ecd5f1bc30f7a2dbfb06f004ca86e589bd54c1d5db2fac74e69233b
|
7
|
+
data.tar.gz: e0bfa3aaae3787009defcf124967c89e855980422bd5c323ab2847f9bf35465233b99f8fd0e87d3bced138cea1464e4e86ee47a6ac566ae0130da8b07b1d4158
|
data/.github/workflows/ci.yml
CHANGED
@@ -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:
|
24
|
+
image: postgres:17
|
23
25
|
env:
|
24
26
|
POSTGRES_USER: postgres
|
25
27
|
POSTGRES_PASSWORD: postgres
|
data/Appraisals
CHANGED
data/Changelog.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
##
|
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.
|
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.
|
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.
|
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.
|
80
|
+
mutex_m (0.2.0)
|
84
81
|
newrelic_rpm (6.15.0)
|
85
|
-
pg (1.
|
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.
|
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
|
data/gemfiles/rails.6.1.gemfile
CHANGED
data/gemfiles/rails.7.0.gemfile
CHANGED
data/hermes-rb.gemspec
CHANGED
@@ -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(
|
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
|
-
|
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)
|
data/lib/hermes/rb/version.rb
CHANGED
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.
|
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:
|
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.
|
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
|