diff options
| author | 2018-12-08 08:56:47 +0000 | |
|---|---|---|
| committer | 2018-12-08 08:56:47 +0000 | |
| commit | 281923a4630d5143826b4a1531c52f2f914b0d33 (patch) | |
| tree | 3489258c29e613ba45ad7e9552a3e2adb151c4d3 /modules | |
| parent | `["review"]["user"]["login"]` -> `["sender"]["login"]` to show who created a (diff) | |
| signature | ||
Check whether we actually have a httpd running when unloading rest_api.py
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/rest_api.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/rest_api.py b/modules/rest_api.py index ecba53f3..f558efca 100644 --- a/modules/rest_api.py +++ b/modules/rest_api.py @@ -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,7 +104,8 @@ class Module(ModuleManager.BaseModule): self.thread.start() def unload(self): - self.httpd.shutdown() + if self.httpd: + self.httpd.shutdown() @utils.hook("received.command.apikey", private_only=True) def api_key(self, event): |
