Check whether we actually have a httpd running when unloading rest_api.py
This commit is contained in:
parent
476e4cc9c1
commit
281923a463
1 changed files with 3 additions and 1 deletions
|
@ -92,6 +92,7 @@ class Module(ModuleManager.BaseModule):
|
|||
global _log
|
||||
_log = self.log
|
||||
|
||||
self.httpd = None
|
||||
if self.bot.get_setting("rest-api", False):
|
||||
self.httpd = http.server.HTTPServer(("", 5000), Handler)
|
||||
self.httpd.socket = ssl.wrap_socket(self.httpd.socket,
|
||||
|
@ -103,6 +104,7 @@ class Module(ModuleManager.BaseModule):
|
|||
self.thread.start()
|
||||
|
||||
def unload(self):
|
||||
if self.httpd:
|
||||
self.httpd.shutdown()
|
||||
|
||||
@utils.hook("received.command.apikey", private_only=True)
|
||||
|
|
Loading…
Reference in a new issue