Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(robot-server): initialize fw update status_cache so we dont hang on bootup when client queries fw updates. #15049

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,13 @@ def __init__(
created_at: datetime,
update_id: str,
complete_callback: Callable[[], Awaitable[None]],
status_cache: Optional[UpdateProgress] = None,
) -> None:
"""Build an _UpdateProcess. Should only be done by the manager."""
self._status_queue = Queue()
self._hw_handle = hw_handle
self._subsystem = subsystem
self._status_cache = None
self._status_cache = status_cache
self._status_cache_lock = Lock()
self._created_at = created_at
self._update_id = update_id
Expand Down Expand Up @@ -346,7 +347,12 @@ async def _complete() -> None:
log.exception(f"Double pop for update on {subsystem}")

self._all_updates_by_id[update_id] = _UpdateProcess(
self._hardware_handle, hw_subsystem, creation_time, update_id, _complete
self._hardware_handle,
hw_subsystem,
creation_time,
update_id,
_complete,
UpdateProgress(UpdateState.queued, 0, None),
)
self._running_updates_by_subsystem[hw_subsystem] = self._all_updates_by_id[
update_id
Expand Down
Loading