Skip to content

Commit

Permalink
quickfix: webhooks: ensure the 'crawl_reviewed' webhook is sent async…
Browse files Browse the repository at this point in the history
…, 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
  • Loading branch information
ikreymer authored Aug 21, 2024
1 parent 7208888 commit 86c9e53
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions backend/btrixcloud/basecrawls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 86c9e53

Please sign in to comment.