Repository navigation
Poll the store every 30s while the Friday release lands - #138
Merged
Merged
Conversation
The store poller checked every 5 minutes, always, so a Friday release could sit on the replica for up to 5 minutes before the rebuild and the weekly email started. Now 30s on Fridays 15:25-16:30 ET: the CFTC's 15:30 release, the Windows producer's 45-minute poll from 15:25, and sync time. The sleep also ends at the window's start, so a 5-minute sleep begun at 15:24 does not carry the first tick to 15:29. The always-on 5-minute baseline stays: the replica can move at times no schedule predicts, so that part must never become a window. The window only tightens it, and a tick is two small JSON reads. Fridays only, because the producer polls only on Fridays; a holiday-week release reaches this box with the next 08:10 catch-up regardless. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The store poller checked every 5 minutes, always. After a Friday release reached the server, it could therefore sit there for up to 5 minutes before the rebuild and the weekly email started. With the rebuild now under a minute (cotmetrics 0.14.2 and 0.14.3), that wait is the largest delay left that this box controls.
What
seconds_until_next_pollalso caps the sleep at the window's start, so a 5-minute sleep begun at 15:24 does not carry the first tick to 15:29.Tests
tests/test_store_poll_interval.py(11 tests) covers the window edges, other days, a sleep capped at the window's start, and the window staying in Eastern time whennowarrives in UTC, summer and winter. Full suite: 897 passed.ruff check src testsclean.🤖 Generated with Claude Code