refactor: Improve indexing notification handling and return values

- Enhanced error handling in the indexing process to differentiate between actual failures and cases where no new documents are processed.
- Updated notification messages to reflect the status accurately, including a message for when no new items are synced.
- Standardized return values across various indexer tasks to return `None` on success, simplifying logging and error management.
This commit is contained in:
Anish Sarkar 2026-01-14 13:16:11 +05:30
parent 18ec9543bd
commit 1ea0475f73
7 changed files with 34 additions and 18 deletions

View file

@ -358,8 +358,11 @@ class ConnectorIndexingNotificationHandler(BaseNotificationHandler):
status = "failed"
else:
title = f"Ready: {connector_name}"
item_text = "item" if indexed_count == 1 else "items"
message = f"Now searchable! {indexed_count} {item_text} synced."
if indexed_count == 0:
message = "Already up to date! No new items to sync."
else:
item_text = "item" if indexed_count == 1 else "items"
message = f"Now searchable! {indexed_count} {item_text} synced."
status = "completed"
metadata_updates = {