diff --git a/src/openflexure_microscope_server/things/smart_scan.py b/src/openflexure_microscope_server/things/smart_scan.py index 4919ef3c..9c7baa84 100644 --- a/src/openflexure_microscope_server/things/smart_scan.py +++ b/src/openflexure_microscope_server/things/smart_scan.py @@ -527,6 +527,8 @@ class SmartScanThing(Thing): ) raise e finally: + # Whether or not this scan succeeded, remove any scan folders containing zero images + self.purge_empty_scans(logger=self._scan_logger) if self._capture_thread: # If the capture thread had an error, we capture it here try: