Commit 569086f6 by Oleksandr Barabash

added logging for the message execution

parent 492a5d5e
""" Bot App """
import json
import sys
import time
import traceback
from datetime import datetime
from http import HTTPStatus
......@@ -169,6 +170,7 @@ async def v1_post_notification(request: Request) -> Response:
async def v1_messages(request: Request) -> Response:
""" messages endpoint """
start = time.time()
if "application/json" in request.headers["Content-Type"]:
body = await request.json()
else:
......@@ -184,6 +186,8 @@ async def v1_messages(request: Request) -> Response:
if invoke_response:
return json_response(data=invoke_response.body,
status=invoke_response.status)
took = time.time() - start
Log.d(TAG, f"v1_messages::nessage handling took: {took} seconds")
return Response(status=HTTPStatus.OK)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment