mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-30 21:59:46 +02:00
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:
parent
18ec9543bd
commit
1ea0475f73
7 changed files with 34 additions and 18 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue