Skip to content

Commit

Permalink
ota_core: fix update/rollback not sending session start status report
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodong-Yang committed Nov 13, 2024
1 parent 1233a1c commit dfd38cb
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/otaclient/ota_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,15 @@ def update(self, request: UpdateRequestV2) -> None:
return

new_session_id = self._gen_session_id(request.version)
logger.info(f"{new_session_id=}")
self._status_report_queue.put_nowait(
StatusReport(
payload=OTAStatusChangeReport(
new_ota_status=OTAStatus.UPDATING,
),
session_id=new_session_id,
)
)
logger.info(f"start new OTA update session: {new_session_id=}")

try:
logger.info("[update] entering local update...")
Expand Down Expand Up @@ -767,6 +775,17 @@ def rollback(self):
if self.is_busy:
return

new_session_id = self._gen_session_id("___rollback")
self._status_report_queue.put_nowait(
StatusReport(
payload=OTAStatusChangeReport(
new_ota_status=OTAStatus.ROLLBACKING,
),
session_id=new_session_id,
)
)
logger.info(f"start new OTA rollback session: {new_session_id=}")

try:
logger.info("[rollback] entering...")
self._live_ota_status = OTAStatus.ROLLBACKING
Expand Down

0 comments on commit dfd38cb

Please sign in to comment.