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 AWS blocking call #119295

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 2 additions & 2 deletions homeassistant/components/aws/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
_LOGGER = logging.getLogger(__name__)


async def get_available_regions(hass, service):
async def get_available_regions(hass: HomeAssistant, service: str) -> list[str]:
"""Get available regions for a service."""
session = AioSession()
return await session.get_available_regions(service)
return await hass.async_add_executor_job(session.get_available_regions, service)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't run a coro in the executor.

This probably needs to be fixed in the library itself or we can work around it by calling whatever its calling under the hood if its initializing / loading a cache from disk before this function so its not called in the event loop when this function does get called.



async def async_get_service(
Expand Down
Loading