Fix google calendar blocking call, running outside of executor (#68948)
This commit is contained in:
parent
4327d3aef9
commit
3c478c312a
1 changed files with 7 additions and 3 deletions
|
@ -183,9 +183,13 @@ class GoogleCalendarService:
|
|||
"""Get the calendar service with valid credetnails."""
|
||||
await self._session.async_ensure_token_valid()
|
||||
creds = _async_google_creds(self._hass, self._session.token)
|
||||
return google_discovery.build(
|
||||
"calendar", "v3", credentials=creds, cache_discovery=False
|
||||
)
|
||||
|
||||
def _build() -> google_discovery.Resource:
|
||||
return google_discovery.build(
|
||||
"calendar", "v3", credentials=creds, cache_discovery=False
|
||||
)
|
||||
|
||||
return await self._hass.async_add_executor_job(_build)
|
||||
|
||||
async def async_list_calendars(
|
||||
self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue