fix: move translation file I/O off the event loop#95
Open
r0bb10 wants to merge 1 commit into
Open
Conversation
Preload translation files into cache via hass.async_add_executor_job before building the dashboard, so _t() calls during dashboard config construction are pure dict lookups with zero blocking I/O. - Add _async_preload_translations() that resolves language and loads both the target and English translations via the async executor - Updated _build_dashboard_config to accept pre-resolved lang param instead of doing its own I/O
Owner
|
Hi, thanks for the contribution — the approach is clean and the async preload is the right direction. One thing to clarify before merging: the current codebase calls Could you check whether If that's the case, adding By(t)e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preload translation files into cache via hass.async_add_executor_job before building the dashboard, so _t() calls during dashboard config construction are pure dict lookups with zero blocking I/O.