Repository navigation
Keep FromLastCompletion polling on its grid when the next run is due sooner [patch] - #102
Conversation
…sooner [patch] The polling wait was extended to a full PollingInterval past a run that finished during it, so when ActionInterval plus the run time fit inside one polling interval every cycle slipped by the run time. Extend the wait only until the run is due: min(ActionInterval, PollingInterval) past completion. Fixes #101 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW3tezLDV1yfkEQRQji
…ays under its bound Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW3tezLDV1yfkEQRQji
|
Generated by Claude Code |
…p stays under its bound The test failed twice on macos-latest with gaps of 770 and 809 ms against a 750 ms bound at 500 ms polling, with no tick skipped (that would be ~1000 ms). At 1 s the 1.5x bound leaves 500 ms for oversleep, and the #93 regression still fails it with 2 s gaps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW3tezLDV1yfkEQRQji
|
On e8ba697, the new test passed on macOS. I checked that it still catches #93: with the completion-based extension disabled locally, the FromLastCompletion rows fail with 2 s gaps. Generated by Claude Code |
|



Fixes #101
What changed
WaitOutPollingIntervalAsyncused to extend the wait to a fullPollingIntervalpast any run that finished during it. WhenActionIntervalplus the run time fits inside one polling interval, the next run is already due on the next tick, so that extension pushed every cycle back by the run time. At the defaults (1 s polling,ActionInterval0, FromLastCompletion) a 900 ms action ended up running about every 1.9 s.The wait is now
max(PollingInterval - (now - start), min(ActionInterval, PollingInterval) - (now - completedAt)). With equal intervals that is the same as before, so #93 stays fixed. The<remarks>now describe the bounded extension.Tests
ShortActionIntervalKeepsToThePollingGridInFromLastCompletion(0/300 ms and 100/250 ms work at 500 ms polling) asserts that no gap between starts reaches 1.25 ×PollingInterval. Without the fix it fails with gaps of about 800 ms and 750 ms. With the fix it passes.EqualPollingAndActionIntervalsSkipNoTicksstill passes.Generated by Claude Code