We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b04dc00 commit ed14ca0Copy full SHA for ed14ca0
1 file changed
aperag/service/document_service.py
@@ -363,7 +363,9 @@ async def _rebuild_document_indexes_atomically(session):
363
raise ResourceNotFoundException(f"Collection {collection_id} not found or access denied")
364
collection_config = json.loads(collection.config)
365
if not collection_config.get("enable_knowledge_graph", False):
366
- index_type_enums.remove(db_models.DocumentIndexType.GRAPH)
+ # Only remove GRAPH type if it's actually in the list to avoid ValueError
367
+ if db_models.DocumentIndexType.GRAPH in index_type_enums:
368
+ index_type_enums.remove(db_models.DocumentIndexType.GRAPH)
369
370
# Trigger index rebuild by incrementing version for selected index types
371
await document_index_manager.create_or_update_document_indexes(session, document_id, index_type_enums)
0 commit comments