Stop the HTTP server properly too

This commit is contained in:
Raoul Snyman 2018-01-06 00:02:45 -07:00
parent f693d3aa37
commit 5612be1b5a
1 changed files with 4 additions and 1 deletions

View File

@ -72,7 +72,10 @@ class HttpWorker(ThreadWorker):
A method to stop the worker
"""
if hasattr(self, 'server'):
self.server.close()
# Loop through all the channels and close them to stop the server
for channel in self.server._map.values():
if hasattr(channel, 'close'):
channel.close()
class HttpServer(RegistryBase, RegistryProperties, LogMixin):