Skip to content
Snippets Groups Projects
Commit f1384625 authored by Sam Kagan's avatar Sam Kagan
Browse files

Updated workflow svc to send complete & fail msgs to AAT for restore_cms

parent 71826eea
No related branches found
No related tags found
No related merge requests found
......@@ -142,6 +142,17 @@ archive_msg_templates = DictView(
"application": "workflow",
"message": "download failed",
},
"restore_cms_complete": {
"application": "workflow",
"message": "restore_cms complete",
"delivery_url": None,
"delivery_path": None,
"token": None,
},
"restore_cms_failed": {
"application": "workflow",
"message": "restore_cms failed",
},
"update": {
"application": "workflow",
"message": "workflow updated",
......
......@@ -924,10 +924,10 @@ class WorkflowMessageHandler:
elif controller.control_system == "AAT":
logger.info(f"Attempting to send delivery notification to AAT from propagate delivery")
# construct the AAT message
routing_key = f"ws-workflow.download.{wf_request.workflow_request_id}"
routing_key = f"ws-workflow.{wf_request.workflow_name}.{wf_request.workflow_request_id}"
msg = ArchiveMessageArchitect(
routing_key=routing_key, request=wf_request, delivery_info=delivery_info
).compose_message("download_complete")
).compose_message(f"{wf_request.workflow_name}_complete")
self.archive_messenger.send_message(**msg)
else:
logger.debug("No delivery.json found")
......@@ -1244,10 +1244,10 @@ class WorkflowMessageHandler:
)
if controller.control_system == "AAT":
# download_complete will be sent from propagate_delivery method
if wf_request.workflow_name == "download" and event_type == "complete":
# download_complete and restore_cms_complete will be sent from propagate_delivery method
if wf_request.workflow_name in ["download", "restore_cms"] and event_type == "complete":
logger.info(
f"Tried to send download workflow complete event from send_external_event to {controller.control_system}"
f"Tried to send download or restore_cms workflow complete event from send_external_event to {controller.control_system}"
)
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment