flipp-oss / deimos

Framework to work with Kafka, Avro and ActiveRecord
Other
59 stars 22 forks source link

poll info is updated when no records are fetched. This enables should… #169

Closed harsha-flipp closed 1 year ago

harsha-flipp commented 1 year ago

…_run to wait for run_every seconds before next round of processing updates

Pull Request Template

Description

DBPoller -- state and time based currently polls and waits for run_every(default=60 seconds) after every run. However, if batch to process returns zero rows, it immediately runs the next loop and it continues again and again until it finds a valid set of items. After which it waits for 60 seconds as expected.

Expectation: It is expected to wait for 60 seconds in scenarios where batch returns zero rows.

This PR fixes the "not waiting" issue by saving last_sent to PollInfo in the scenario where batch of records to process is empty.

Fixes # (issue)

Type of change

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Checklist:

dorner commented 1 year ago

@harsha-flipp looks good but lint is failing! 😄