Skip to content

Commit

Permalink
Revert "Return JobID to UDM"
Browse files Browse the repository at this point in the history
This reverts commit fc5d100.
  • Loading branch information
nmgaston committed Sep 30, 2024
1 parent 9b0ccfa commit 2bd9a5e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions inbm/dispatcher-agent/dispatcher/dispatcher_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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":
Expand Down

0 comments on commit 2bd9a5e

Please sign in to comment.