Skip to content

Commit

Permalink
refresh session
Browse files Browse the repository at this point in the history
  • Loading branch information
mruwnik committed Dec 17, 2023
1 parent 8de159f commit bacfd1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions align_data/common/alignment_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ def commit() -> bool:
session.rollback()
return False

with make_session() as session:
items = iter(entries)
while batch := tuple(islice(items, self.batch_size)):
items = iter(entries)
while batch := tuple(islice(items, self.batch_size)):
with make_session() as session:
self._add_batch(session, batch)
# there might be duplicates in the batch, so if they cause
# an exception, try to commit them one by one
Expand Down

0 comments on commit bacfd1d

Please sign in to comment.