Start script runs eagerly (#113190)
This commit is contained in:
parent
92e73312ea
commit
bdede0e0da
6 changed files with 33 additions and 8 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue