fix: 🐛 crawl (#2076)

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):
This commit is contained in:
Stan Girard 2024-01-23 23:39:45 -08:00 committed by GitHub
parent 45e9a1a10e
commit ae81afbef5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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(
@ -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."}