deimos-ruby 1.18.1 → 1.18.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/deimos/utils/db_poller/state_based.rb +5 -2
- data/lib/deimos/utils/db_poller/time_based.rb +4 -1
- data/lib/deimos/version.rb +1 -1
- data/spec/utils/db_poller_spec.rb +15 -0
- 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: a3f5f0c1fdba2cf641706b6c18733f433c04f42e3e06f5871ab0050a0215cc61
|
4
|
+
data.tar.gz: 9c758f1d7e62dd9cd91e1631b3211cc9388adb0bb7b3dfea7b29099b46224bc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30b074497e6efe25e87d6e4736ecba0725b5bb4b20dcfba9bc82a655c9ee246986b9a655ceeec05b6bfa57b0633fecafb3cf7e1335322bd40a4254b3d973944f
|
7
|
+
data.tar.gz: 798513006a509d7439e4d09c18a6a547bac683bcbb4a56013447fad59ba941702072f828d6ec8966da6fec8096659a686de7f796d858923e17fdcf7f21235318
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## UNRELEASED
|
9
9
|
|
10
|
+
# 1.18.2 - 2022-11-14
|
11
|
+
|
12
|
+
- Fixes bug related to wait between runs when no records are fetched by updating poll_info
|
13
|
+
|
10
14
|
# 1.18.1 - 2022-11-01
|
11
15
|
|
12
16
|
- Fix the primary_key detection way in `state_based` mode
|
@@ -18,7 +18,10 @@ module Deimos
|
|
18
18
|
loop do
|
19
19
|
Deimos.config.logger.debug("Polling #{@producer.topic}, batch #{status.current_batch}")
|
20
20
|
batch = fetch_results.to_a
|
21
|
-
|
21
|
+
if batch.empty?
|
22
|
+
@info.touch(:last_sent)
|
23
|
+
break
|
24
|
+
end
|
22
25
|
|
23
26
|
success = process_batch_with_span(batch, status)
|
24
27
|
finalize_batch(batch, success)
|
@@ -35,7 +38,7 @@ module Deimos
|
|
35
38
|
# @param success [Boolean]
|
36
39
|
# @return [void]
|
37
40
|
def finalize_batch(batch, success)
|
38
|
-
@info.touch
|
41
|
+
@info.touch(:last_sent)
|
39
42
|
|
40
43
|
state = success ? @config.published_state : @config.failed_state
|
41
44
|
klass = batch.first.class
|
@@ -36,7 +36,10 @@ module Deimos
|
|
36
36
|
loop do
|
37
37
|
Deimos.config.logger.debug("Polling #{@producer.topic}, batch #{status.current_batch}")
|
38
38
|
batch = fetch_results(time_from, time_to).to_a
|
39
|
-
|
39
|
+
if batch.empty?
|
40
|
+
@info.touch(:last_sent)
|
41
|
+
break
|
42
|
+
end
|
40
43
|
|
41
44
|
process_and_touch_info(batch, status)
|
42
45
|
time_from = last_updated(batch.last)
|
data/lib/deimos/version.rb
CHANGED
@@ -333,6 +333,21 @@ each_db_config(Deimos::Utils::DbPoller::Base) do
|
|
333
333
|
with('Poll my-topic-with-id complete at 2015-05-05 00:59:58 -0400 (3 batches, 0 errored batches, 7 processed messages)')
|
334
334
|
end
|
335
335
|
|
336
|
+
it 'should update PollInfo timestamp after processing' do
|
337
|
+
poll_before = Deimos::PollInfo.last
|
338
|
+
poller.process_updates
|
339
|
+
poll_after = Deimos::PollInfo.last
|
340
|
+
expect(poll_after.last_sent).to be >= poll_before.last_sent
|
341
|
+
end
|
342
|
+
|
343
|
+
it 'should update PollInfo timestamp when there are no records to process' do
|
344
|
+
allow(poller).to receive(:fetch_results).and_return([])
|
345
|
+
poll_before = Deimos::PollInfo.last
|
346
|
+
poller.process_updates
|
347
|
+
poll_after = Deimos::PollInfo.last
|
348
|
+
expect(poll_after.last_sent).to be >= poll_before.last_sent
|
349
|
+
end
|
350
|
+
|
336
351
|
describe 'errors' do
|
337
352
|
before(:each) do
|
338
353
|
poller.config.retries = 0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deimos-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.18.
|
4
|
+
version: 1.18.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Orner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avro_turf
|