mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-19 15:23:20 +00:00
guard relativemove failures (#24835)
This commit is contained in:
1 parent
9b0aa75312
commit
a0b8d40a66
2 files changed
+15
-1
No files matched your search
@@ -625,7 +625,12 @@ class OnvifController:
|
||||
|
||||
move_request.Speed = move_speed
|
||||
|
||||
await cam["ptz"].RelativeMove(move_request)
|
||||
try:
|
||||
await cam["ptz"].RelativeMove(move_request)
|
||||
except Exception as e:
|
||||
logger.warning(
|
||||
f"Onvif sending relative move request to {camera_name} failed: {e}"
|
||||
)
|
||||
|
||||
# reset after the move request
|
||||
move_request.Translation.PanTilt.x = 0
|
||||
|
||||
@@ -195,6 +195,15 @@ class TestManualRelativeMoveMetrics(unittest.IsolatedAsyncioTestCase):
|
||||
)
|
||||
)
|
||||
|
||||
async def test_failed_move_does_not_raise(self) -> None:
|
||||
# an exception here ends the autotracker's move queue consumer for good
|
||||
controller = _make_move_controller(autotracking_enabled=True)
|
||||
controller.cams[CAMERA]["ptz"].RelativeMove.side_effect = TimeoutError
|
||||
|
||||
await controller._move_relative(CAMERA, 0.25, -0.25, 0, 1)
|
||||
|
||||
self.assertFalse(controller.cams[CAMERA]["active"])
|
||||
|
||||
async def test_metrics_written_when_autotracking_enabled(self) -> None:
|
||||
# get_camera_status resets stop_time once the camera reports IDLE, so the
|
||||
# autotracking path keeps its motion estimation timestamps
|
||||
|
||||
Reference in new issue
Block a user