fix: make Azure DevOps webhook handler asynchronous

This commit is contained in:
Hussam.lawen
2025-02-26 17:13:38 +02:00
parent 52a68bcd44
commit 70a2377ac9

View File

@ -33,7 +33,7 @@ azure_devops_server = get_settings().get("azure_devops_server")
WEBHOOK_USERNAME = azure_devops_server.get("webhook_username") WEBHOOK_USERNAME = azure_devops_server.get("webhook_username")
WEBHOOK_PASSWORD = azure_devops_server.get("webhook_password") WEBHOOK_PASSWORD = azure_devops_server.get("webhook_password")
def handle_request_comment( url: str, body: str, log_context: dict async def handle_request_comment( url: str, body: str, log_context: dict
): ):
log_context["action"] = body log_context["action"] = body
log_context["api_url"] = url log_context["api_url"] = url
@ -121,7 +121,7 @@ async def handle_request_azure(data, log_context):
for action in actions: for action in actions:
try: try:
handle_request_comment(pr_url, action, log_context) await handle_request_comment(pr_url, action, log_context)
except Exception as e: except Exception as e:
get_logger().error("Azure DevOps Trigger failed. Error:" + str(e)) get_logger().error("Azure DevOps Trigger failed. Error:" + str(e))
return JSONResponse( return JSONResponse(