hermes-rb 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +2 -1
- data/Gemfile.lock +5 -5
- data/lib/hermes/consumer_builder.rb +13 -1
- data/lib/hermes/rb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59686770a8a0d625f3fdafba40cea1d8d2ea9abf2d9a0e178913d721a2251af5
|
4
|
+
data.tar.gz: 47a0d261cda5cd0fb9d7d3f3c453ec5a45e3aedf4581ef8e61483fe6b455dec1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12897e2edc96239c057816a94feddc88c8c484a2b5660db4d56b78a22e2864508ca87ca7c4f3231695e133d33f9eb42299303c9356819d88c595678e3eddc7e1
|
7
|
+
data.tar.gz: e17c18ba924688fe8606e3019c63f26cab7ba58089ea489c8f1a6fa2afc7e932093192a4e7948233c05d07ee673f2b4ae521d21f59276fffee28c0a4ac8db484
|
data/Changelog.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hermes-rb (0.9.
|
4
|
+
hermes-rb (0.9.1)
|
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)
|
@@ -45,7 +45,7 @@ GEM
|
|
45
45
|
ddtrace (0.45.0)
|
46
46
|
msgpack
|
47
47
|
diff-lcs (1.4.4)
|
48
|
-
drb (2.
|
48
|
+
drb (2.2.0)
|
49
49
|
ruby2_keywords
|
50
50
|
dry-container (0.11.0)
|
51
51
|
concurrent-ruby (~> 1.0)
|
@@ -80,7 +80,7 @@ GEM
|
|
80
80
|
minitest (5.20.0)
|
81
81
|
msgpack (1.4.2)
|
82
82
|
multi_json (1.15.0)
|
83
|
-
mutex_m (0.
|
83
|
+
mutex_m (0.2.0)
|
84
84
|
newrelic_rpm (6.15.0)
|
85
85
|
pg (1.2.3)
|
86
86
|
rack (3.0.8)
|
@@ -108,7 +108,7 @@ GEM
|
|
108
108
|
set (~> 1.0)
|
109
109
|
thor (1.2.1)
|
110
110
|
timecop (0.9.2)
|
111
|
-
timeout (0.4.
|
111
|
+
timeout (0.4.1)
|
112
112
|
tzinfo (2.0.6)
|
113
113
|
concurrent-ruby (~> 1.0)
|
114
114
|
vcr (5.0.0)
|
@@ -26,7 +26,12 @@ module Hermes
|
|
26
26
|
logger.log_enqueued(event_class, body, headers, config.clock.now)
|
27
27
|
else
|
28
28
|
ensure_database_connection!
|
29
|
-
|
29
|
+
begin
|
30
|
+
result = event_processor.call(event_class.to_s, body, headers)
|
31
|
+
rescue StandardError => error
|
32
|
+
rescue_from_closed_db_connection(error)
|
33
|
+
raise error
|
34
|
+
end
|
30
35
|
event = result.event
|
31
36
|
response = result.response
|
32
37
|
|
@@ -64,6 +69,13 @@ module Hermes
|
|
64
69
|
config.database_connection_provider.connection.reconnect! if config.database_connection_provider
|
65
70
|
Hermes::DistributedTrace.connection.reconnect! if config.store_distributed_traces?
|
66
71
|
end
|
72
|
+
|
73
|
+
def rescue_from_closed_db_connection(error)
|
74
|
+
if error.to_s.include?("PG::ConnectionBad")
|
75
|
+
config.database_connection_provider.connection_pool.disconnect! if config.database_connection_provider
|
76
|
+
Hermes::DistributedTrace.connection_pool.disconnect! if config.store_distributed_traces?
|
77
|
+
end
|
78
|
+
end
|
67
79
|
end
|
68
80
|
|
69
81
|
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.9.
|
4
|
+
version: 0.9.1
|
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-
|
11
|
+
date: 2023-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|