…_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
[ ] Bug fix (non-breaking change which fixes an issue)
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
Ran State based poller and time based poller locally and simulated the scenario of having a huge batch of records to process. Observed that it waits for 60 seconds after processing is complete.
Replicated the same scenario with zero records qualified by poll query. It now waits for 60 seconds after no records are found.
Repeated first scenario for state based poller
Repeated second scenario for state based poller
Checklist:
[] My code follows the style guidelines of this project
[] I have performed a self-review of my own code
[] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] I have added a line in the CHANGELOG describing this change, under the UNRELEASED heading
[] My changes generate no new warnings
[] I have added tests that prove my fix is effective or that my feature works
[] New and existing unit tests pass locally with my changes
[] Any dependent changes have been merged and published in downstream modules
…_run to wait for
run_every
seconds before next round of processing updatesPull 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
Ran State based poller and time based poller locally and simulated the scenario of having a huge batch of records to process. Observed that it waits for 60 seconds after processing is complete.
Replicated the same scenario with zero records qualified by poll query. It now waits for 60 seconds after no records are found.
Repeated first scenario for state based poller
Repeated second scenario for state based poller
Checklist: