mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-02 19:55:18 +02:00
fix: Ensure notification updates are reliable during error handling
- Added session refresh for notifications to prevent stale data after rollbacks in multiple document processing tasks. - Wrapped notification update logic in try-except blocks to handle potential failures gracefully and log errors without crashing the process. - Improved error handling for notification updates in various document processing functions, enhancing overall robustness.
This commit is contained in:
parent
69f46ff3f4
commit
9d0f5b4249
2 changed files with 58 additions and 22 deletions
|
|
@ -1090,6 +1090,8 @@ async def _run_indexing_with_notifications(
|
|||
# Update notification on exception
|
||||
if notification:
|
||||
try:
|
||||
# Refresh notification to ensure it's not stale after any rollback
|
||||
await session.refresh(notification)
|
||||
await NotificationService.connector_indexing.notify_indexing_completed(
|
||||
session=session,
|
||||
notification=notification,
|
||||
|
|
@ -1824,6 +1826,8 @@ async def run_google_drive_indexing(
|
|||
# Update notification on exception
|
||||
if notification:
|
||||
try:
|
||||
# Refresh notification to ensure it's not stale after any rollback
|
||||
await session.refresh(notification)
|
||||
await NotificationService.connector_indexing.notify_indexing_completed(
|
||||
session=session,
|
||||
notification=notification,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue