Start script runs eagerly (#113190)

This commit is contained in:
J. Nick Koston 2024-03-14 16:53:26 -10:00 committed by GitHub
parent 92e73312ea
commit bdede0e0da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 33 additions and 8 deletions

View file

@ -77,6 +77,7 @@ from homeassistant.core import (
callback,
)
from homeassistant.util import slugify
from homeassistant.util.async_ import create_eager_task
from homeassistant.util.dt import utcnow
from . import condition, config_validation as cv, service, template
@ -1611,7 +1612,7 @@ class Script:
self._changed()
try:
return await asyncio.shield(run.async_run())
return await asyncio.shield(create_eager_task(run.async_run()))
except asyncio.CancelledError:
await run.async_stop()
self._changed()