From 36c395ba72d3a6cc7bfb45e96e3cb3d8af6b0aa6 Mon Sep 17 00:00:00 2001 From: Manoj Aggarwal Date: Fri, 9 Jan 2026 13:20:54 -0800 Subject: [PATCH] nit --- .../app/routes/search_source_connectors_routes.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/surfsense_backend/app/routes/search_source_connectors_routes.py b/surfsense_backend/app/routes/search_source_connectors_routes.py index 73a593186..c9831484d 100644 --- a/surfsense_backend/app/routes/search_source_connectors_routes.py +++ b/surfsense_backend/app/routes/search_source_connectors_routes.py @@ -1251,14 +1251,11 @@ async def run_teams_indexing( update_last_indexed=False, # Don't update timestamp in the indexing function ) - # Update last_indexed_at if indexing was successful (regardless of new/skipped docs) - if error_or_warning is None: - await update_connector_last_indexed(session, connector_id) - logger.info( - f"Teams indexing completed successfully: {documents_processed} documents processed" - ) - else: - logger.error(f"Teams indexing failed: {error_or_warning}") + # Update last_indexed_at after successful indexing (even if 0 new docs - they were checked) + await update_connector_last_indexed(session, connector_id) + logger.info( + f"Teams indexing completed successfully: {documents_processed} documents processed. {error_or_warning or ''}" + ) except Exception as e: logger.error(f"Error in background Teams indexing task: {e!s}")