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 committed Jan 4, 2024
1 parent da48073 commit 1369e9b
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 @@ -173,6 +173,8 @@ sub process_motions {

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 @@ -201,4 +203,7 @@ sub process_alignments {
}

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

0 comments on commit 1369e9b

Please sign in to comment.