From 9dbdad4f8c510afdd02356d8003e3bb45c5f9b73 Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Wed, 3 Jun 2026 17:25:35 +0100 Subject: [PATCH] Fix robust capture logic to break on success --- src/openflexure_microscope_server/things/camera/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openflexure_microscope_server/things/camera/__init__.py b/src/openflexure_microscope_server/things/camera/__init__.py index f494f01b..8df0cfa7 100644 --- a/src/openflexure_microscope_server/things/camera/__init__.py +++ b/src/openflexure_microscope_server/things/camera/__init__.py @@ -638,7 +638,7 @@ class BaseCamera(OFMThing, ABC): image = self._capture_image(capture_mode=capture_mode) success = True - continue + break except TimeoutError: self.logger.warning( f"Attempt {capture_attempts + 1} to capture image timed out. "