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
This commit is contained in:
Ilya Kreymer 2024-08-20 17:50:18 -07:00 committed by GitHub
parent 7208888a1c
commit 86c9e538c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -254,8 +254,13 @@ class BaseCrawlOps:
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}