Support client restart without updating

This commit is contained in:
shortcutme 2018-07-10 03:28:02 +02:00
parent 77aa23a375
commit 5aab10fab2
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
3 changed files with 17 additions and 16 deletions

View file

@ -960,7 +960,9 @@ class UiWebsocket(object):
res = sys.modules["main"].file_server.openport()
self.response(to, res)
def actionServerShutdown(self, to):
def actionServerShutdown(self, to, restart=False):
if restart:
sys.modules["main"].restart_after_shutdown = True
sys.modules["main"].file_server.stop()
sys.modules["main"].ui_server.stop()

View file

@ -20,6 +20,7 @@ else: # Old gevent
# Not thread: pyfilesystem and systray icon, Not subprocess: Gevent 1.1+
update_after_shutdown = False # If set True then update and restart zeronet after main loop ended
restart_after_shutdown = False # If set True then restart zeronet after main loop ended
# Load config
from Config import config
@ -175,6 +176,7 @@ class Actions(object):
logging.info("Starting servers....")
gevent.joinall([gevent.spawn(ui_server.start), gevent.spawn(file_server.start)])
logging.info("All server stopped")
# Site commands