diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2022-06-15 17:19:06 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2022-06-15 17:19:06 +0300 |
commit | f11ad1ba74739414697de50eab44e2b4604defa0 (patch) | |
tree | 4e2ee6b4baff7e0ada88638a78e19694a21ac587 /src | |
parent | 167445676ac24e8d54dd9b1a0d1a8d7c05b6420e (diff) |
media/record: fix terminating a program that doesn't want to be terminated
Diffstat (limited to 'src')
-rw-r--r-- | src/home/media/record.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/home/media/record.py b/src/home/media/record.py index d2f9b0e..fdb8382 100644 --- a/src/home/media/record.py +++ b/src/home/media/record.py @@ -214,8 +214,12 @@ class Recording: try: self.process.wait(timeout=timeout) except subprocess.TimeoutExpired: - self.logger.warning(f'stop: wait({timeout}): timeout expired, calling terminate()') - self.process.terminate() + self.logger.warning(f'stop: wait({timeout}): timeout expired, killing it') + try: + os.kill(self.recorder_program_pid, signal.SIGKILL) + self.process.terminate() + except Exception as exc: + self.logger.exception(exc) else: self.logger.warning(f'stop: pid of {self.RECORDER_PROGRAM} is unknown, calling terminate()') self.process.terminate() |