Browse Source

configurable transcoder timeout

master
dave 8 months ago
parent
commit
5225180994
  1. 5
      pysonic/api.py

5
pysonic/api.py

@ -11,6 +11,9 @@ import cherrypy
logging = logging.getLogger("api")
TRANSCODE_TIMEOUT = int(os.environ.get("PYSONIC_ENCODE_TIMEOUT", 5 * 60))
def extension(mime):
r = TYPE_TO_EXTENSION.get(mime)
print(f"getting extension for {mime}: {r}")
@ -244,7 +247,7 @@ class PysonicSubsonicApi(object):
def stopit(proc):
try:
proc.wait(timeout=90)
proc.wait(timeout=TRANSCODE_TIMEOUT)
except subprocess.TimeoutExpired:
logging.warning("killing timed-out transcoder")
proc.kill()

Loading…
Cancel
Save