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

Avoid loading timezone at runtime #157

Merged
merged 2 commits into from
Jun 4, 2024
Merged

Avoid loading timezone at runtime #157

merged 2 commits into from
Jun 4, 2024

Conversation

elupus
Copy link
Contributor

@elupus elupus commented Jun 3, 2024

Pytz will load timezone info from files in
a lazy fashion on first access. This triggers warnings in HA due to it blocking the event loop.

Pre-load the needed timezone info at module import instead, which will run in executor in HA.

Fixes #156

Pytz will load timezone info from files in
a lazy fashion on first access. This triggers warnings in HA due to it blocking the event loop.

Pre-load the needed timezone info at module import instead, which will run in
executor in HA.
@ndokter ndokter merged commit b42ceb6 into ndokter:master Jun 4, 2024
6 checks passed
@ndokter
Copy link
Owner

ndokter commented Jun 4, 2024

Thanks! I will make a new build soon

@bdraco
Copy link
Contributor

bdraco commented Jun 6, 2024

#154

Would be nice to fix this one as well. I can do a PR if it's desired

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.

Detected blocking call to open in pytz
3 participants