deimos-ruby 1.18.1 → 1.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 823450875be7162e712e18a4ef8dbfc2cb42b7891196eef87ca3052521eb59c1
4
- data.tar.gz: f1eb07016db4e812342fadbaa2efbea29244a32207a5f472fc4c4f2d35961a88
3
+ metadata.gz: a3f5f0c1fdba2cf641706b6c18733f433c04f42e3e06f5871ab0050a0215cc61
4
+ data.tar.gz: 9c758f1d7e62dd9cd91e1631b3211cc9388adb0bb7b3dfea7b29099b46224bc7
5
5
  SHA512:
6
- metadata.gz: 3f078251cf32655b278c0e1d8e9e32e436bb3ff2c15e669c5243e8134541ba581915cd0e94780abe6447e659ad95a20b4241250d14c32b7198832742651d56fe
7
- data.tar.gz: a11952adb501faac033e594942a7fb5c1607c6f7bdbb54e0632fd344d151883ad0c415df3016f15b489df6be4d0c3fd2ff196d7565ad55238e64220acd0169fa
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
- break if batch.empty?
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
- break if batch.empty?
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deimos
4
- VERSION = '1.18.1'
4
+ VERSION = '1.18.2'
5
5
  end
@@ -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.1
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-01 00:00:00.000000000 Z
11
+ date: 2022-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avro_turf