mirror of
https://github.com/janeczku/calibre-web
synced 2024-12-25 17:40:31 +00:00
Bugfix server restart to prevent infinite calibre-web instances
This commit is contained in:
parent
6119eb3681
commit
38c601bb10
@ -194,6 +194,8 @@ class WebServer(object):
|
|||||||
rv.extend(("-m", py_module.lstrip(".")))
|
rv.extend(("-m", py_module.lstrip(".")))
|
||||||
|
|
||||||
rv.extend(args)
|
rv.extend(args)
|
||||||
|
if os.name == 'nt':
|
||||||
|
rv = ['"{}"'.format(a) for a in rv]
|
||||||
return rv
|
return rv
|
||||||
|
|
||||||
def _start_gevent(self):
|
def _start_gevent(self):
|
||||||
@ -263,10 +265,7 @@ class WebServer(object):
|
|||||||
|
|
||||||
log.info("Performing restart of Calibre-Web")
|
log.info("Performing restart of Calibre-Web")
|
||||||
args = self._get_args_for_reloading()
|
args = self._get_args_for_reloading()
|
||||||
if os.environ.get('FLASK_DEBUG'):
|
os.execv(args[0].lstrip('"').rstrip('"'), args)
|
||||||
subprocess.run(args, close_fds=True) # nosec
|
|
||||||
else:
|
|
||||||
subprocess.run(args, close_fds=True) # nosec
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user