-
-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Unload scripts created by websocket command execute_script #169368
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1076,6 +1076,8 @@ async def handle_execute_script( | |||||||||||||||||||||
| translation_placeholders=err.translation_placeholders, | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| return | ||||||||||||||||||||||
| finally: | ||||||||||||||||||||||
| script_obj.async_unload() | ||||||||||||||||||||||
|
Comment on lines
+1079
to
+1080
|
||||||||||||||||||||||
| def _finish(self) -> None: | |
| self._script._runs.remove(self) # noqa: SLF001 | |
| if not self._script.is_running: | |
| self._script.last_action = None | |
| self._changed() | |
| self._stopped.set() |
The only real risk is if the cleanup here is itself cancelled, but I don't think that matters for the websocket command handler:
core/homeassistant/helpers/script.py
Lines 1872 to 1875 in 46297fd
| except asyncio.CancelledError: | |
| await run.async_stop() | |
| self._changed() | |
| raise |
Uh oh!
There was an error while loading. Please reload this page.