Support client restart without updating
This commit is contained in:
parent
77aa23a375
commit
5aab10fab2
3 changed files with 17 additions and 16 deletions
|
@ -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()
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue