Skip to content

Commit add807f

Browse files
committed
Fixed wrong extraction of results from 'do_insert_data_collection' call in 'register_data_collection' module; added logs
1 parent e5e4506 commit add807f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/murfey/workflows/register_data_collection.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ def run(
2020
logger.error("Unable to find transport manager")
2121
return {"success": False, "requeue": False}
2222

23-
logger.info(
24-
"Registering the following data collection:\n"
25-
f"{', '.join([f'{sanitise(key)}: {sanitise(str(value))}' for key, value in message.items()])}"
26-
)
23+
logger.info(f"Registering the following data collection: \n{message}")
2724

2825
murfey_session_id = message["session_id"]
2926
ispyb_session_id = get_session_id(
@@ -86,7 +83,7 @@ def run(
8683
if message["experiment_type"] == "tomography"
8784
else ""
8885
),
89-
)
86+
).get("return_value", None)
9087
murfey_dc = MurfeyDB.DataCollection(
9188
id=dcid,
9289
tag=message.get("tag"),
@@ -98,5 +95,10 @@ def run(
9895
murfey_db.close()
9996

10097
if dcid is None:
98+
logger.error(
99+
"Failed to register the following data collection: \n"
100+
f"{message} \n"
101+
"Requeueing message"
102+
)
101103
return {"success": False, "requeue": True}
102104
return {"success": True}

0 commit comments

Comments
 (0)