Skip to content

Commit

Permalink
fix: 🐛 crawl (#2076)
Browse files Browse the repository at this point in the history
notification id issue when not in chat fixed

# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
  • Loading branch information
StanGirard authored Jan 24, 2024
1 parent 45e9a1a commit ae81afb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/routes/crawl_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ async def crawl_endpoint(
"type": "error",
}
else:
crawl_notification = None
crawl_notification_id = None
if chat_id:
crawl_notification = notification_service.add_notification(
crawl_notification_id = notification_service.add_notification(
CreateNotificationProperties(
action="CRAWL",
chat_id=chat_id,
status=NotificationsStatusEnum.Pending,
)
).id
)

knowledge_to_add = CreateKnowledgeProperties(
Expand All @@ -78,7 +78,7 @@ async def crawl_endpoint(
process_crawl_and_notify.delay(
crawl_website_url=crawl_website.url,
brain_id=brain_id,
notification_id=crawl_notification.id,
notification_id=crawl_notification_id,
)

return {"message": "Crawl processing has started."}
Expand Down

0 comments on commit ae81afb

Please sign in to comment.