Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Services] fix logging issue and typing #1064

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Services/Interfaces/web_interface/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 8 additions & 5 deletions Services/Services_bases/webhook_service/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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('/')
Expand Down