Fix PVOutput 10-minute gaps by using clock-aligned upload intervals#241
Open
rianbk wants to merge 1 commit intobohdan-s:mainfrom
Open
Fix PVOutput 10-minute gaps by using clock-aligned upload intervals#241rianbk wants to merge 1 commit intobohdan-s:mainfrom
rianbk wants to merge 1 commit intobohdan-s:mainfrom
Conversation
Uploads were happening every ~5:30 instead of 5:00 due to elapsed-time tracking that accumulated processing delays. This caused 11 uploads/hour instead of 12, skipping one PVOutput slot per hour. Changed from wall-clock elapsed time to interval-number tracking, ensuring uploads align to clock boundaries (e.g., :00, :05, :10) with no drift.
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.
Summary
Problem
The previous code used
time.time() - last_publish >= intervalwhich caused uploads every ~5:30 instead of 5:00 due to processing time being added after each upload. This resulted in 11 uploads/hour instead of 12, causing one 5-minute slot to be skipped each hour.Log evidence:
Solution
Use interval-number tracking aligned to clock boundaries:
This ensures uploads align to clock boundaries (e.g., :00, :05, :10) with no drift.
Test plan