From 2bd9a5e8825ef792e5d717d54fb4ee77eb858de5 Mon Sep 17 00:00:00 2001 From: Natalie Gaston Date: Thu, 12 Sep 2024 15:04:34 -0700 Subject: [PATCH] Revert "Return JobID to UDM" This reverts commit fc5d100a0c093f2da5f420a3c84afd2dc033704a. --- inbm/dispatcher-agent/dispatcher/dispatcher_class.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/inbm/dispatcher-agent/dispatcher/dispatcher_class.py b/inbm/dispatcher-agent/dispatcher/dispatcher_class.py index ac39016ea..ab8410c91 100644 --- a/inbm/dispatcher-agent/dispatcher/dispatcher_class.py +++ b/inbm/dispatcher-agent/dispatcher/dispatcher_class.py @@ -496,7 +496,7 @@ def _on_cloud_request(self, topic: str, payload: str, qos: int) -> None: request_type = topic.split('/')[2] request_id = topic.split('/')[3] if len(topic.split('/')) > 3 else None manifest = payload - self._add_request_to_queue(request_type, manifest, request_id) + self._add_cmd_to_queue(request_type, manifest, request_id) def _on_message(self, topic: str, payload: Any, qos: int) -> None: """Called when a message is received from _telemetry-agent @@ -804,7 +804,15 @@ def process_scheduled_requests(scheduled_requests: Sequence[Schedule]): dispatcher.ap_scheduler.add_repeated_schedule_job(dispatcher.run_scheduled_job, repeated_schedule) logger.debug(f"Scheduled repeated job: {repeated_schedule}") - + # Dispatcher sends back the acknowledgement response before processing the immediate scheduling. + dispatcher._send_result("", request_id) + for imm in schedule.immedate_requests: + for manifest in imm.manifests: + try: + dispatcher._add_cmd_to_queue(request_type, manifest, request_id) + except (NotImplementedError, DispatcherException) as e: + # TODO: Save the error for query request + logger.error(str(e)) return if request_type == "install" or request_type == "query":