mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-05 13:20:39 +08:00
fix: make Azure DevOps webhook handler asynchronous
This commit is contained in:
@ -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(
|
||||||
|
Reference in New Issue
Block a user