From 635635dcc67606490bc3fbd2b3973454c742e365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Tue, 3 Dec 2024 00:35:26 -0800 Subject: [PATCH] Do not run post-exposure checks if cancelling --- src/gort/overwatcher/observer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gort/overwatcher/observer.py b/src/gort/overwatcher/observer.py index 1b5d82f..73b16fe 100644 --- a/src/gort/overwatcher/observer.py +++ b/src/gort/overwatcher/observer.py @@ -415,6 +415,9 @@ async def pre_observe_checks(self): async def post_exposure(self, exp: Exposure | bool): """Runs post-exposure checks.""" + if self._cancelling: + return + if exp is False: raise GortError("No exposure was returned.") @@ -422,9 +425,6 @@ async def post_exposure(self, exp: Exposure | bool): transparency = self.overwatcher.transparency transparency.write_to_log(["sci"]) - if self._cancelling: - return - if transparency.quality["sci"] & TransparencyQuality.BAD: await self.notify( "Transparency is bad. Stopping observations and starting "