Skip to content

fix(camera-api): stop serving frozen frames when a patrol hangs - #458

Open
MateoLostanlen wants to merge 5 commits into
developfrom
fix/camera-api-stale-patrol
Open

MateoLostanlen wants to merge 5 commits into
developfrom
fix/camera-api-stale-patrol

Conversation

@MateoLostanlen

@MateoLostanlen MateoLostanlen commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Part of pyronear/roadmap#16, fixes the camera API side of #422.

  • Every Reolink request now has a 10 s default timeout. A PTZ call without timeout could block a patrol thread forever.
  • Each stored image keeps its capture time. latest_image returns 204 when the image is older than max_age_s (default 300 s), so the engine stops scoring frozen frames and stops sending heartbeats for that camera.
  • /health/patrols returns 503 when a running patrol makes no progress for 10 min. The compose healthcheck then kills every process but PID 1 (tini, via init: true) so restart: always brings the container back. /health stays a plain liveness check, as the Shelly watchdog uses it to decide whether to power-cycle the Pi.

@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.51%. Comparing base (a2604d4) to head (3a25856).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #458   +/-   ##
========================================
  Coverage    80.51%   80.51%           
========================================
  Files            6        6           
  Lines          847      847           
========================================
  Hits           682      682           
  Misses         165      165           
Flag Coverage Δ
unittests 80.51% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
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