1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-26 17:47:20 +00:00

Prevent spawning of new instance of CherryPy before the first one has stopped.

This commit is contained in:
Louis Vézina 2018-10-16 20:26:44 -04:00
parent 3e17afc028
commit 7186fc8968

View file

@ -209,6 +209,11 @@ def shutdown():
@route(base_url + 'restart') @route(base_url + 'restart')
def restart(): def restart():
try:
server.stop()
except:
logging.error('Cannot stop CherryPy.')
else:
try: try:
restart_file = open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "bazarr.restart"), "w") restart_file = open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "bazarr.restart"), "w")
except Exception as e: except Exception as e:
@ -216,7 +221,6 @@ def restart():
else: else:
restart_file.write('') restart_file.write('')
restart_file.close() restart_file.close()
server.stop()
@route(base_url + 'static/:path#.+#', name='static') @route(base_url + 'static/:path#.+#', name='static')