Collection deletion batch error fixed (#559)

Collection deletion caused a batch error, this reduces batch size on deletion
This commit is contained in:
cybermaggedon 2025-11-13 16:29:40 +00:00 committed by GitHub
parent db4e842df3
commit 2baf21c5e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -334,13 +334,14 @@ class KnowledgeGraph:
count += 1
# Execute batch every 100 triples to avoid oversized batches
if count % 100 == 0:
# Execute batch every 25 triples to avoid oversized batches
# (Each triple adds ~4 statements, so 25 triples = ~100 statements)
if count % 25 == 0:
self.session.execute(batch)
batch = BatchStatement()
# Execute remaining deletions
if count % 100 != 0:
if count % 25 != 0:
self.session.execute(batch)
# Step 3: Delete collection metadata