@@ -53,18 +53,17 @@ def run(
5353 dcgid = _transport_object .do_insert_data_collection_group (record ).get (
5454 "return_value" , None
5555 )
56+
5657 atlas_record = ISPyBDB .Atlas (
5758 dataCollectionGroupId = dcgid ,
5859 atlasImage = message .get ("atlas" , "" ),
5960 pixelSize = message .get ("atlas_pixel_size" , 0 ),
6061 cassetteSlot = message .get ("sample" ),
6162 )
62- if _transport_object :
63- atlas_id = _transport_object .do_insert_atlas (atlas_record ).get (
64- "return_value" , None
65- )
66- else :
67- atlas_id = None
63+ atlas_id = _transport_object .do_insert_atlas (atlas_record ).get (
64+ "return_value" , None
65+ )
66+
6867 murfey_dcg = MurfeyDB .DataCollectionGroup (
6968 id = dcgid ,
7069 atlas_id = atlas_id ,
@@ -77,6 +76,7 @@ def run(
7776 murfey_db .add (murfey_dcg )
7877 murfey_db .commit ()
7978 murfey_db .close ()
79+
8080 if dcgid is None :
8181 time .sleep (2 )
8282 logger .error (
@@ -85,6 +85,7 @@ def run(
8585 "Requeuing message"
8686 )
8787 return {"success" : False , "requeue" : True }
88+
8889 if dcg_hooks := entry_points ().select (
8990 group = "murfey.hooks" , name = "data_collection_group"
9091 ):
@@ -93,4 +94,5 @@ def run(
9394 hook .load ()(dcgid , session_id = message ["session_id" ])
9495 except Exception :
9596 logger .error ("Call to data collection group hook failed" , exc_info = True )
97+
9698 return {"success" : True }
0 commit comments