Merge pull request 'Auto-commit local changes before build (2026-01-08 16:54:10)' (#73) from v20260108-38-missed-run-grace-window into main

Reviewed-on: #73
This commit is contained in:
Ivo Oskamp 2026-01-13 11:29:21 +01:00
commit 1e683a9c0d
3 changed files with 29 additions and 1 deletions

View File

@ -1 +1 @@
v20260108-37-synology-updates-info-parser
v20260108-38-missed-run-grace-window

View File

@ -113,6 +113,8 @@ def _ensure_missed_runs_for_job(job: Job, start_from: date, end_inclusive: date)
now_local_dt = datetime.now(tz) if tz else datetime.utcnow()
now_utc_naive = _utc_naive_from_local(now_local_dt)
# Remove any previously generated missed runs in this date window.
# Missed runs must be based on learned schedule from real mail-reported runs.
try:
@ -164,6 +166,15 @@ def _ensure_missed_runs_for_job(job: Job, start_from: date, end_inclusive: date)
slot_utc_naive = _utc_naive_from_local(local_dt)
# Do not mark as missed until the full grace window has passed.
if now_utc_naive <= (slot_utc_naive + MISSED_GRACE_WINDOW):
continue
# Consider any real run near the slot as fulfilling the schedule.
# Also avoid duplicates if a missed run already exists.
window_start = slot_utc_naive - MISSED_GRACE_WINDOW
@ -238,6 +249,15 @@ def _ensure_missed_runs_for_job(job: Job, start_from: date, end_inclusive: date)
slot_utc_naive = _utc_naive_from_local(local_dt)
# Do not mark as missed until the full grace window has passed.
if now_utc_naive <= (slot_utc_naive + MISSED_GRACE_WINDOW):
continue
window_start = slot_utc_naive - MISSED_GRACE_WINDOW
window_end = slot_utc_naive + MISSED_GRACE_WINDOW

View File

@ -96,6 +96,14 @@
- Set overall status to Warning without creating schedules or expected-run logic.
- Excluded Synology Updates informational messages from reporting output.
---
## v20260108-38-missed-run-grace-window
- Adjusted missed run detection to respect a ±1 hour grace window around the scheduled run time.
- Prevented runs that arrive shortly after the scheduled time (e.g. a few minutes late) from being temporarily marked as Missed.
- Ensured Missed status is only applied after the full grace window has elapsed, avoiding false Missed entries in Run Checks and Daily Jobs.
================================================================================================================================================
## v0.1.18