mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-29 02:23:44 +02:00
Collection deletion batch error fixed (#559)
Collection deletion caused a batch error, this reduces batch size on deletion
This commit is contained in:
parent
db4e842df3
commit
2baf21c5e1
1 changed files with 4 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue