@@ -56,7 +56,7 @@ class CLEMPreprocessingResult(BaseModel):
5656 extent : list [float ]
5757
5858
59- def run (message : dict , murfey_db : Session , demo : bool = False ) -> bool :
59+ def run (message : dict , murfey_db : Session , demo : bool = False ) -> dict [ str , bool ] :
6060 session_id : int = (
6161 int (message ["session_id" ])
6262 if not isinstance (message ["session_id" ], int )
@@ -72,13 +72,13 @@ def run(message: dict, murfey_db: Session, demo: bool = False) -> bool:
7272 logger .error (
7373 f"Invalid type for TIFF preprocessing result: { type (message ['result' ])} "
7474 )
75- return False
75+ return { "success" : False , "requeue" : False }
7676 except Exception :
7777 logger .error (
7878 "Exception encountered when parsing TIFF preprocessing result: \n "
7979 f"{ traceback .format_exc ()} "
8080 )
81- return False
81+ return { "success" : False , "requeue" : False }
8282
8383 # Outer try-finally block for tidying up database-related section of function
8484 try :
@@ -181,7 +181,7 @@ def run(message: dict, murfey_db: Session, demo: bool = False) -> bool:
181181 f"{ result .series_name !r} : \n "
182182 f"{ traceback .format_exc ()} "
183183 )
184- return False
184+ return { "success" : False , "requeue" : False }
185185
186186 # Load instrument name
187187 try :
@@ -197,7 +197,7 @@ def run(message: dict, murfey_db: Session, demo: bool = False) -> bool:
197197 f"Error requesting data from database for { result .series_name !r} series: \n "
198198 f"{ traceback .format_exc ()} "
199199 )
200- return False
200+ return { "success" : False , "requeue" : False }
201201
202202 # Construct list of files to use for image alignment and merging steps
203203 image_combos_to_process = [
@@ -234,12 +234,12 @@ def run(message: dict, murfey_db: Session, demo: bool = False) -> bool:
234234 f"{ result .series_name !r} series" ,
235235 exc_info = True ,
236236 )
237- return False
237+ return { "success" : False , "requeue" : False }
238238 logger .info (
239239 "Successfully requested image alignment and merging job for "
240240 f"{ result .series_name !r} series"
241241 )
242- return True
242+ return { "success" : True }
243243
244244 finally :
245245 murfey_db .close ()
0 commit comments