From 86c9e538c138c11e3b022eff74575cbfc3fdaf70 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Tue, 20 Aug 2024 17:50:18 -0700 Subject: [PATCH] quickfix: webhooks: ensure the 'crawl_reviewed' webhook is sent async, doesn't delay submitting a review (#2033) make the call to `create_crawl_reviewed_notification` be called with create_task (similar to other user-initiated webhook events), to avoid extra wait for webhook to complete --- backend/btrixcloud/basecrawls.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/btrixcloud/basecrawls.py b/backend/btrixcloud/basecrawls.py index c96fcd127e..2df1bfabb1 100644 --- a/backend/btrixcloud/basecrawls.py +++ b/backend/btrixcloud/basecrawls.py @@ -254,8 +254,13 @@ async def update_crawl( if update_values.get("reviewStatus"): crawl = BaseCrawl.from_dict(result) - await self.event_webhook_ops.create_crawl_reviewed_notification( - crawl.id, crawl.oid, crawl.reviewStatus, crawl.description + asyncio.create_task( + self.event_webhook_ops.create_crawl_reviewed_notification( + crawl.id, + crawl.oid, + crawl.reviewStatus, + crawl.description, + ) ) return {"updated": True}