Skip to content

Commit

Permalink
fix: fix signal handling (#76)
Browse files Browse the repository at this point in the history
Signed-off-by: Trevor Blanchard <blantrev@amazon.com>
  • Loading branch information
ttblanchard committed Feb 21, 2024
1 parent acc4dde commit bc38027
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/openjd/adaptor_runtime_client/win_client_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from .base_client_interface import Response as _Response
import http.client
import signal as _signal
import threading as _threading


from .base_client_interface import BaseClientInterface
Expand All @@ -26,8 +25,10 @@ def __init__(self, server_path: str) -> None:
server_path (str): Used as pipe name in Named Pipe Server.
"""
super().__init__(server_path)
if _threading.current_thread() is _threading.main_thread():
try:
_signal.signal(_signal.SIGBREAK, self.graceful_shutdown) # type: ignore[attr-defined]
except ValueError:
pass

def _send_request(
self,
Expand Down

0 comments on commit bc38027

Please sign in to comment.