fix: daily report no longer flags a stack as silent when run mid-session

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B3PXXn2tHBzdv6rYtGPz86
This commit is contained in:
momentum devandClaude Opus 5.5 committed 2026-10-02 11:11:27 -05:00
1 parent 1101e0e3fe
commit ac92280b9a
1 file changed
+2 -1
+2 -1
View File
@@ -193,7 +193,8 @@ def health_section(paper, live, today, alerts) -> list[str]:
alerts.append(f"The {name} stack was silent for {gap_min:.0f} min during market hours.")
if n == 0:
alerts.append(f"The {name} stack wrote no heartbeats during market hours.")
elif last and last.strftime("%H:%M") < "15:45":
elif last and (datetime.now(ET).replace(tzinfo=None) - last).total_seconds() > 900 \
and last.strftime("%H:%M") < "15:45": # silent for 15+ min, before the close
alerts.append(f"The {name} stack went silent at {last:%H:%M} ET.")
except Exception as e: # noqa: BLE001
lines.append(f"- {name}: ERROR {str(e)[:120]}")