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:
Pierre Ossman 2017-10-27 08:41:32 +02:00
parent 0a6e0c2d87
commit 5f7d28aeb6
1 changed files with 4 additions and 1 deletions

View File

@ -343,6 +343,7 @@ class WebSockifyServer(object):
self.launch_time = time.time()
self.ws_connection = False
self.handler_id = 1
self.terminating = False
self.logger = self.get_logger()
self.tcp_keepalive = tcp_keepalive
@ -600,7 +601,9 @@ class WebSockifyServer(object):
pass
def terminate(self):
raise self.Terminate()
if not self.terminating:
self.terminating = True
raise self.Terminate()
def multiprocessing_SIGCHLD(self, sig, stack):
# TODO: figure out a way to actually log this information without