Fix webhook listen (#1383)

The `listen` argument wasn't being passed through to Tornado; this fixes
it.

Fixes #1382
This commit is contained in:
Jason Rhinelander 2019-04-15 04:28:41 -03:00 committed by Noam Meltzer
parent 984bea16d1
commit 2cde878d1e
2 changed files with 4 additions and 3 deletions

View file

@ -383,7 +383,7 @@ class Updater(object):
ssl_ctx = None
# Create and start server
self.httpd = WebhookServer(port, app, ssl_ctx)
self.httpd = WebhookServer(listen, port, app, ssl_ctx)
if use_ssl:
# DO NOT CHANGE: Only set webhook if SSL is handled by library

View file

@ -34,8 +34,9 @@ logging.getLogger(__name__).addHandler(logging.NullHandler())
class WebhookServer(object):
def __init__(self, port, webhook_app, ssl_ctx):
def __init__(self, listen, port, webhook_app, ssl_ctx):
self.http_server = HTTPServer(webhook_app, ssl_options=ssl_ctx)
self.listen = listen
self.port = port
self.loop = None
self.logger = logging.getLogger(__name__)
@ -48,7 +49,7 @@ class WebhookServer(object):
IOLoop().make_current()
self.is_running = True
self.logger.debug('Webhook Server started.')
self.http_server.listen(self.port)
self.http_server.listen(self.port, address=self.listen)
self.loop = IOLoop.current()
self.loop.start()
self.logger.debug('Webhook Server stopped.')