X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FDB%2FLoad.pm;h=a85a4ec28eaaa97a3876c1c9258aebbe8d070a27;hb=758f570dbc0f13d4dd3b656b24882154ef218e37;hp=6f300f96f6690c07beb4764cb4c311141f181607;hpb=918d7b5b08bf6d65825d9f88cc939ac0eb92df03;p=debbugs.git diff --git a/Debbugs/DB/Load.pm b/Debbugs/DB/Load.pm index 6f300f9..a85a4ec 100644 --- a/Debbugs/DB/Load.pm +++ b/Debbugs/DB/Load.pm @@ -571,8 +571,15 @@ sub load_packages { } # remove associations for packages not in this suite if (@sa_to_del) { - $schema->resultset('SrcAssociation')-> - search_rs({id => \@sa_to_del})->delete(); + $it = natatime 1000, @sa_to_del; + while (my @v = $it->()) { + $schema-> + txn_do(sub { + $schema->resultset('SrcAssociation')-> + search_rs({id => \@v})-> + delete(); + }); + } } # update packages in this suite to have a modification time of now $schema->resultset('SrcAssociation')-> @@ -635,8 +642,15 @@ sub load_packages { scalar @v) if defined $p; } if (@bin_to_del) { - $schema->resultset('BinAssociation')-> - search_rs({id => \@bin_to_del})->delete(); + $it = natatime 1000, @bin_to_del; + while (my @v = $it->()) { + $schema-> + txn_do(sub { + $schema->resultset('BinAssociation')-> + search_rs({id => \@v})-> + delete(); + }); + } } $schema->resultset('BinAssociation')-> search_rs({suite => $suite_id})-> @@ -683,3 +697,7 @@ sub load_suite { __END__ +# Local Variables: +# indent-tabs-mode: nil +# cperl-indent-level: 4 +# End: