mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-10 20:35:17 +02:00
fix(luma): commit failed status immediately
This commit is contained in:
parent
8191118eb4
commit
e3afe9d7c7
1 changed files with 6 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ Implements 2-phase document status updates for real-time UI feedback:
|
|||
"""
|
||||
|
||||
import asyncio
|
||||
import contextlib
|
||||
import time
|
||||
from collections.abc import Awaitable, Callable
|
||||
from datetime import datetime, timedelta
|
||||
|
|
@ -485,10 +486,15 @@ async def index_luma_events(
|
|||
try:
|
||||
document.status = DocumentStatus.failed(str(e))
|
||||
document.updated_at = get_current_timestamp()
|
||||
# Commit now so the failed status survives a later rollback or
|
||||
# crash; otherwise the doc stays stuck in pending/processing.
|
||||
await session.commit()
|
||||
except Exception as status_error:
|
||||
logger.error(
|
||||
f"Failed to update document status to failed: {status_error}"
|
||||
)
|
||||
with contextlib.suppress(Exception):
|
||||
await session.rollback()
|
||||
skipped_events.append(
|
||||
f"{item.get('event_name', 'Unknown')} (processing error)"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue