catch full mpv request queue

presumably happening if multiple requests are sent before previous
response fetch times out

Caught exception:
  File "aqt/webview.py", line 314, in handler
  File "aqt/editor.py", line 351, in <lambda>
  File "aqt/addcards.py", line 225, in afterSave
  File "aqt/addcards.py", line 231, in doClose
  File "aqt/addcards.py", line 210, in _reject
  File "anki/sound.py", line 417, in clearAudioQueue
  File "anki/sound.py", line 117, in clearQueue
  File "anki/mpv.py", line 558, in command
  File "anki/mpv.py", line 352, in _send_request
  File "anki/mpv.py", line 311, in _send_message
<class 'anki.mpv.MPVTimeoutError'>: unable to put request
This commit is contained in:
Damien Elmes 2019-04-21 18:56:11 +10:00
parent 8497da27cf
commit 7df402b006

View file

@ -349,8 +349,8 @@ class MPVBase:
"""Send a command to the mpv process and collect the result. """Send a command to the mpv process and collect the result.
""" """
self.ensure_running() self.ensure_running()
self._send_message(message, timeout)
try: try:
self._send_message(message, timeout)
return self._get_response(timeout) return self._get_response(timeout)
except MPVCommandError as e: except MPVCommandError as e:
raise MPVCommandError("%r: %s" % (message["command"], e)) raise MPVCommandError("%r: %s" % (message["command"], e))