configurable transcoder timeout
This commit is contained in:
parent
5e0e541cf9
commit
5225180994
|
@ -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…
Reference in New Issue