mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-11 23:39:31 -05:00
Force shutdowns the socket server on closing chat server
This commit is contained in:
parent
530f9547f5
commit
a4ae37d203
@ -360,13 +360,18 @@ class Web:
|
|||||||
# Shutdown the flask service
|
# Shutdown the flask service
|
||||||
try:
|
try:
|
||||||
func = request.environ.get("werkzeug.server.shutdown")
|
func = request.environ.get("werkzeug.server.shutdown")
|
||||||
if func is None:
|
if func is None and self.mode != "chat":
|
||||||
raise RuntimeError("Not running with the Werkzeug Server")
|
raise RuntimeError("Not running with the Werkzeug Server")
|
||||||
func()
|
func()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self.running = False
|
self.running = False
|
||||||
|
|
||||||
|
# If chat, shutdown the socket server
|
||||||
|
if self.mode == "chat":
|
||||||
|
self.socketio.stop()
|
||||||
|
|
||||||
def start(self, port):
|
def start(self, port):
|
||||||
"""
|
"""
|
||||||
Start the flask web server.
|
Start the flask web server.
|
||||||
|
Loading…
Reference in New Issue
Block a user