fix sigint handling

This commit is contained in:
Moishe Lettvin
2024-02-14 12:10:47 -05:00
parent 2516670874
commit 1992b7e79e
3 changed files with 5 additions and 0 deletions

View File

@@ -194,10 +194,13 @@ class DailyTransportService(BaseTransportService, EventHandler):
if self._token and self._start_transcription:
self.client.start_transcription(self.transcription_settings)
self.original_sigint_handler = signal.getsignal(signal.SIGINT)
signal.signal(signal.SIGINT, self.process_interrupt_handler)
def process_interrupt_handler(self, signum, frame):
self._post_run()
if callable(self.original_sigint_handler):
self.original_sigint_handler(signum, frame)
def _post_run(self):
self.client.leave()