diff options
Diffstat (limited to 'backend/decky_loader/plugin/sandboxed_plugin.py')
| -rw-r--r-- | backend/decky_loader/plugin/sandboxed_plugin.py | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/backend/decky_loader/plugin/sandboxed_plugin.py b/backend/decky_loader/plugin/sandboxed_plugin.py index 93691a44..23575900 100644 --- a/backend/decky_loader/plugin/sandboxed_plugin.py +++ b/backend/decky_loader/plugin/sandboxed_plugin.py @@ -1,6 +1,5 @@ import sys from os import path, environ -from signal import SIG_IGN, SIGINT, SIGTERM, getsignal, signal from importlib.util import module_from_spec, spec_from_file_location from json import dumps, loads from logging import getLogger @@ -19,8 +18,6 @@ from typing import List, TypeVar, Any DataType = TypeVar("DataType") -original_term_handler = getsignal(SIGTERM) - class SandboxedPlugin: def __init__(self, name: str, @@ -48,11 +45,6 @@ class SandboxedPlugin: self._socket = socket try: - # Ignore signals meant for parent Process - # TODO SURELY there's a better way to do this. - signal(SIGINT, SIG_IGN) - signal(SIGTERM, SIG_IGN) - setproctitle(f"{self.name} ({self.file})") setthreadtitle(self.name) @@ -120,7 +112,7 @@ class SandboxedPlugin: get_event_loop().create_task(self.Plugin._main()) else: get_event_loop().create_task(self.Plugin._main(self.Plugin)) - get_event_loop().create_task(socket.setup_server()) + get_event_loop().create_task(socket.setup_server(self.on_new_message)) except: self.log.error("Failed to start " + self.name + "!\n" + format_exc()) sys.exit(0) @@ -167,8 +159,6 @@ class SandboxedPlugin: data = loads(message) if "stop" in data: - # Incase the loader needs to terminate our process soon - signal(SIGTERM, original_term_handler) self.log.info(f"Calling Loader unload function for {self.name}.") await self._unload() |
