Shield Reolink webhook callback from cancelation (#89798)

* shield Reolink webhook callback from cancelation

* Update homeassistant/components/reolink/host.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* fix styling

* fix black

* Revert to using asyncio.shield

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
pull/89973/head
starkillerOG 2023-03-20 04:35:16 +01:00 committed by GitHub
parent c94b054d75
commit 939fce4607
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -327,6 +327,12 @@ class ReolinkHost:
async def handle_webhook(
self, hass: HomeAssistant, webhook_id: str, request: Request
):
"""Shield the incoming webhook callback from cancellation."""
await asyncio.shield(self.handle_webhook_shielded(hass, webhook_id, request))
async def handle_webhook_shielded(
self, hass: HomeAssistant, webhook_id: str, request: Request
):
"""Handle incoming webhook from Reolink for inbound messages and calls."""