Skip to content

Commit

Permalink
fix : _kill_play_process function updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sepandhaghighi committed Sep 10, 2024
1 parent 36127cd commit b4c848d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions nava/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ def __init__(self, loop, engine, *args, **kwargs):
self._engine = engine
self._nava_exception = None

def _kill_play_process(self):
def _kill_play_process(self, wait=True):
"""
Kill play process.
:param wait: wait flag
:type wait: bool
:return: None
"""
if self._play_process is not None:
Expand All @@ -44,7 +46,8 @@ def _kill_play_process(self):
except ProcessLookupError:
pass
finally:
self._play_process.wait()
if wait:
self._play_process.wait()

def run(self):
"""
Expand All @@ -64,7 +67,7 @@ def run(self):
break
except Exception: # pragma: no cover
self._nava_exception = SOUND_FILE_PLAY_ERROR
self._kill_play_process()
self._kill_play_process(wait=False)
raise NavaBaseError(SOUND_FILE_PLAY_ERROR)

def stop(self):
Expand Down

0 comments on commit b4c848d

Please sign in to comment.