From 522aad54f91b9a01c8f5ff0d1841288bcb64a410 Mon Sep 17 00:00:00 2001 From: "Yuri (solarw) Turchenkov" Date: Thu, 3 Oct 2024 10:36:26 +0300 Subject: [PATCH] revert back tendermint.py signal handling --- operate/services/utils/tendermint.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/operate/services/utils/tendermint.py b/operate/services/utils/tendermint.py index ecda35a0..9fa90d43 100644 --- a/operate/services/utils/tendermint.py +++ b/operate/services/utils/tendermint.py @@ -188,14 +188,6 @@ def __init__( self.log_file = os.environ.get("LOG_FILE", DEFAULT_TENDERMINT_LOG_FILE) self.write_to_log = write_to_log - def _set_on_stop_handler(self): - signal.signal(signal.SIGINT, self._stop_signal_handler) - signal.signal(signal.SIGTERM, self._stop_signal_handler) - - def _stop_signal_handler(self): - self.logger.info("Handling stop signal!") - self.stop() - def _build_init_command(self) -> List[str]: """Build the 'init' command.""" cmd = [ @@ -266,7 +258,6 @@ def _start_monitoring_thread(self) -> None: def start(self, debug: bool = False) -> None: """Start a Tendermint node process.""" - self._set_on_stop_handler() self._start_tm_process(debug) self._start_monitoring_thread() @@ -319,8 +310,8 @@ def _stop_monitoring_thread(self) -> None: def stop(self) -> None: """Stop a Tendermint node process.""" - self._stop_monitoring_thread() self._stop_tm_process() + self._stop_monitoring_thread() @staticmethod def _write_to_console(line: str) -> None: