Skip to content

Commit ed14ca0

Browse files
committed
chore: tidy up
1 parent b04dc00 commit ed14ca0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

aperag/service/document_service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,9 @@ async def _rebuild_document_indexes_atomically(session):
363363
raise ResourceNotFoundException(f"Collection {collection_id} not found or access denied")
364364
collection_config = json.loads(collection.config)
365365
if not collection_config.get("enable_knowledge_graph", False):
366-
index_type_enums.remove(db_models.DocumentIndexType.GRAPH)
366+
# 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)
367369

368370
# Trigger index rebuild by incrementing version for selected index types
369371
await document_index_manager.create_or_update_document_indexes(session, document_id, index_type_enums)

0 commit comments

Comments
 (0)