Only start termination process once
We can't deal with the exception once we've started to shut down so make sure it's only raised once.
This commit is contained in:
parent
0a6e0c2d87
commit
5f7d28aeb6
|
@ -343,6 +343,7 @@ class WebSockifyServer(object):
|
||||||
self.launch_time = time.time()
|
self.launch_time = time.time()
|
||||||
self.ws_connection = False
|
self.ws_connection = False
|
||||||
self.handler_id = 1
|
self.handler_id = 1
|
||||||
|
self.terminating = False
|
||||||
|
|
||||||
self.logger = self.get_logger()
|
self.logger = self.get_logger()
|
||||||
self.tcp_keepalive = tcp_keepalive
|
self.tcp_keepalive = tcp_keepalive
|
||||||
|
@ -600,7 +601,9 @@ class WebSockifyServer(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def terminate(self):
|
def terminate(self):
|
||||||
raise self.Terminate()
|
if not self.terminating:
|
||||||
|
self.terminating = True
|
||||||
|
raise self.Terminate()
|
||||||
|
|
||||||
def multiprocessing_SIGCHLD(self, sig, stack):
|
def multiprocessing_SIGCHLD(self, sig, stack):
|
||||||
# TODO: figure out a way to actually log this information without
|
# TODO: figure out a way to actually log this information without
|
||||||
|
|
Loading…
Reference in New Issue