Skip to content

Commit

Permalink
Add autocommit to alignment loading
Browse files Browse the repository at this point in the history
- Now importing quite a lot.
- Making commit manual for efficiency.
  • Loading branch information
ajparsons authored and dracos committed Jan 16, 2024
1 parent fae806b commit 6d9c2dc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/json2db.pl
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ sub process_policydivisions {

sub process_alignments {
my ($alignments, $dreamid) = @_;
# Set AutoCommit off
$dbh->{AutoCommit} = 0;
foreach (@$alignments) {
$align_count++;
say $align_count if $verbose && $align_count % 100 == 0;
Expand Down Expand Up @@ -206,4 +208,7 @@ sub process_alignments {
}

}
$dbh->commit();
# Set AutoCommit on
$dbh->{AutoCommit} = 1;
}

0 comments on commit 6d9c2dc

Please sign in to comment.