Skip to content

Fix PVOutput 10-minute gaps by using clock-aligned upload intervals#241

Open
rianbk wants to merge 1 commit intobohdan-s:mainfrom
rianbk:fix/pvoutput-gaps
Open

Fix PVOutput 10-minute gaps by using clock-aligned upload intervals#241
rianbk wants to merge 1 commit intobohdan-s:mainfrom
rianbk:fix/pvoutput-gaps

Conversation

@rianbk
Copy link
Copy Markdown
Contributor

@rianbk rianbk commented Jan 9, 2026

Summary

  • Fixes intermittent 10-minute gaps appearing on PVOutput intraday data approximately every hour
  • Changes from elapsed-time tracking to interval-number tracking for upload timing

Problem

The previous code used time.time() - last_publish >= interval which 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:

00:02:36 → 00:08:06 (5:30)
00:08:06 → 00:13:36 (5:30)
00:13:36 → 00:19:06 (5:30)

Solution

Use interval-number tracking aligned to clock boundaries:

current_interval = int(time.time() // (self.status_interval * 60))
if current_interval > self.last_uploaded_interval:

This ensures uploads align to clock boundaries (e.g., :00, :05, :10) with no drift.

Test plan

  • Verified uploads now happen at exact 5-minute intervals (19:40:16 → 19:45:16 → 19:50:16)
  • Confirmed countdown timer decreases correctly
  • Monitor PVOutput intraday page for 24+ hours to confirm no gaps

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant