Skip to content

Do not block at startup #309

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

Merged
merged 5 commits into from
Jan 20, 2022
Merged

Do not block at startup #309

merged 5 commits into from
Jan 20, 2022

Conversation

emontnemery
Copy link
Contributor

@emontnemery emontnemery commented Jan 19, 2022

Cloud.initialize refreshes the access token (if needed) and waits until RemoteUI is connected, which will block for a very long time if we're not connected to the network.

This changes such that we return before the potentially long-running network access to allow HA core to initialize cloud when there's no network, access token refresh and remote connection is handed off to a task.

To synchronize completion of initialization, it's possible to register on_initialized callbacks.

Co-authored-by: Paulus Schoutsen <[email protected]>
@emontnemery emontnemery merged commit 72b333f into master Jan 20, 2022
@delete-merged-branch delete-merged-branch bot deleted the startup_no_block branch January 20, 2022 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants