From: Olli-Antti Kivilahti Date: Thu, 6 Nov 2014 14:38:37 +0000 (+0200) Subject: Bug 13214 - Improve performance of acqui/addorderiso2709.pl, stop fetching all import... X-Git-Tag: v3.20.00-beta~941 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=e232f3b64abe50eb24b37ae2308678b0f3351481;p=koha-ffzg.git Bug 13214 - Improve performance of acqui/addorderiso2709.pl, stop fetching all import_records needlessly TEST PLAN: 1. Load 167 staged files to Koha. 2. Try to make an acquisiton from a staged file. 3. Wait 16s for the acqui/addorderiso2709.pl -view to load. AFTER PATCH: 1. Load 167 staged files to Koha. 2. Try to make an acquisiton from a staged file. 3. Wait 1.6s for the acqui/addorderiso2709.pl -view to load. Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index 666e771ba6..8637a776b8 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -331,7 +331,7 @@ sub import_batches_list { foreach my $batch (@$batches) { if ( $batch->{'import_status'} =~ /^staged$|^reverted$/ ) { # check if there is at least 1 line still staged - my $stagedList=GetImportRecordsRange($batch->{'import_batch_id'}, undef, undef, $batch->{import_status}, { order_by_direction => 'ASC' }); + my $stagedList=GetImportRecordsRange($batch->{'import_batch_id'}, undef, 1, $batch->{import_status}, { order_by_direction => 'ASC' }); if (scalar @$stagedList) { push @list, { import_batch_id => $batch->{'import_batch_id'},