deimos-ruby 1.23.1.pre.beta2 → 1.23.1.pre.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/deimos/instrumentation.rb +0 -1
- data/lib/deimos/utils/db_poller/base.rb +13 -0
- data/lib/deimos/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89259c86278401bf810b90ec9b611cda1e7fd8fc9d35a0bace0c5fe8ffdc58ae
|
4
|
+
data.tar.gz: eb14298f1b4facd22ef4ce80b0d412dc4b416a49c6c7c3fd82a5517ac4bd1629
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20cb3e0bcfc150c6e1e7905f8514d1e73ac557e3f28fe71c3879dac4a84b349c66b148f6a8a248ecad1f348b474462b0fe038353ce1fbf23340ba1698f6ffd78
|
7
|
+
data.tar.gz: f539adc543e4eef62d2477e1f4a2342952b9384190b8520460b59077781c5638b344a870d196e90bd689a1de62db0ac03e4d2317865007566f4c4c73591ba509
|
@@ -105,6 +105,17 @@ module Deimos
|
|
105
105
|
raise Deimos::MissingImplementationError
|
106
106
|
end
|
107
107
|
|
108
|
+
# @param span [Object]
|
109
|
+
# @param e [Exception]
|
110
|
+
def set_error_and_retry(span, e)
|
111
|
+
span.set_error(e)
|
112
|
+
span.finish
|
113
|
+
Deimos.config.tracer&.start(
|
114
|
+
'deimos-db-poller',
|
115
|
+
resource: @resource_class.name.gsub('::', '-')
|
116
|
+
)
|
117
|
+
end
|
118
|
+
|
108
119
|
# @param batch [Array<ActiveRecord::Base>]
|
109
120
|
# @param status [PollStatus]
|
110
121
|
# @return [Boolean]
|
@@ -119,12 +130,14 @@ module Deimos
|
|
119
130
|
Deimos.config.tracer&.finish(span)
|
120
131
|
status.batches_processed += 1
|
121
132
|
rescue Kafka::Error => e # keep trying till it fixes itself
|
133
|
+
span = set_error_and_retry(span, e)
|
122
134
|
Deimos.config.logger.error("Error publishing through DB Poller: #{e.message}")
|
123
135
|
sleep(0.5)
|
124
136
|
retry
|
125
137
|
rescue StandardError => e
|
126
138
|
Deimos.config.logger.error("Error publishing through DB poller: #{e.message}}")
|
127
139
|
if @config.retries.nil? || retries < @config.retries
|
140
|
+
span = set_error_and_retry(span, e)
|
128
141
|
retries += 1
|
129
142
|
sleep(0.5)
|
130
143
|
retry
|
data/lib/deimos/version.rb
CHANGED