From bd98a7c93ffd5d613f51aa71ee3f1c0b395ad3fa Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Sun, 1 Oct 2023 15:19:23 +0200 Subject: [PATCH] [Services] fix logging issue and typing --- Services/Interfaces/web_interface/web.py | 1 - Services/Services_bases/webhook_service/webhook.py | 13 ++++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Services/Interfaces/web_interface/web.py b/Services/Interfaces/web_interface/web.py index 4b1fbcac8..d8d020ace 100644 --- a/Services/Interfaces/web_interface/web.py +++ b/Services/Interfaces/web_interface/web.py @@ -188,7 +188,6 @@ def init_flask_plugins_and_config(self, server_instance): security.register_responses_extra_header(server_instance, True) - def _handle_login(self, server_instance): self.web_login_manger = login.WebLoginManager(server_instance, self.password_hash) login.set_is_login_required(self.requires_password) diff --git a/Services/Services_bases/webhook_service/webhook.py b/Services/Services_bases/webhook_service/webhook.py index 88eebb32b..5cc50193e 100644 --- a/Services/Services_bases/webhook_service/webhook.py +++ b/Services/Services_bases/webhook_service/webhook.py @@ -128,7 +128,7 @@ def is_subscribed(self, feed_name): return feed_name in self.service_feed_webhooks @staticmethod - def connect(port, protocol="http") -> str: + def connect(port, protocol="http") -> ngrok.NgrokTunnel: """ Create a new ngrok tunnel :param port: the tunnel local port @@ -155,14 +155,17 @@ def get_subscribe_url(self, service_feed_name): def _prepare_webhook_server(self): try: - self.webhook_server = gevent.pywsgi.WSGIServer((self.webhook_host, self.webhook_port), - self.webhook_app, - log=None) + self.logger.debug(f"Starting local webhook server at {self.webhook_host}:{self.webhook_port}") + self.webhook_server = gevent.pywsgi.WSGIServer( + (self.webhook_host, self.webhook_port), + self.webhook_app, + log=None + ) self.webhook_server_context = self.webhook_app.app_context() self.webhook_server_context.push() except OSError as e: self.webhook_server = None - self.get_logger().exception(e, False, f"Fail to start webhook : {e}") + self.logger.exception(e, False, f"Fail to start webhook : {e}") def _register_webhook_routes(self, blueprint) -> None: @blueprint.route('/')