feat: improve webhook filtering, worker status startup handling, and timestamp parsing

- Skip half_hour_report events from webhook posts in people_flow
- Handle pre-existing stale worker status files during startup gracefully
- Make store_dwell_alert timestamp parsing robust against invalid/empty values
- Update lessons learned and todo documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-10 17:05:31 +08:00
parent 9cde462cd1
commit 4e2ca3cff7
8 changed files with 148 additions and 63 deletions

View File

@@ -11,6 +11,10 @@ def _payload_for_webhook(payload: dict) -> dict:
return outbound
def _should_post_webhook(payload: dict) -> bool:
return payload.get("event") != "half_hour_report"
def dispatch_json_event(
path: str | Path,
payload: dict,
@@ -22,7 +26,7 @@ def dispatch_json_event(
with output_path.open("a", encoding="utf-8") as handle:
handle.write(json.dumps(payload, ensure_ascii=False) + "\n")
if not webhook_url.strip():
if not webhook_url.strip() or not _should_post_webhook(payload):
return
req = request.Request(