Bug 19532: (QA follow-up) Move as_list to iterator based loop

Adjusting both new cron jobs.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Marcel de Rooy 2022-03-02 15:24:46 +00:00 committed by Fridolin Somers
parent a3437fd930
commit 3e2b55f64c
2 changed files with 4 additions and 4 deletions

View file

@ -37,8 +37,8 @@ use C4::Log;
cronlogaction();
my @recalls = Koha::Recalls->search({ old => undef })->as_list;
foreach my $recall (@recalls) {
my $recalls = Koha::Recalls->search({ old => undef });
while( my $recall = $recalls->next ) {
if ( ( $recall->requested or $recall->overdue ) and $recall->expirationdate and dt_from_string( $recall->expirationdate ) < dt_from_string() ){
# recall is requested or overdue and has surpassed the specified expiration date
$recall->set_expired({ interface => 'COMMANDLINE' });

View file

@ -36,8 +36,8 @@ use C4::Log;
cronlogaction();
my @recalls = Koha::Recalls->search({ status => 'R' })->as_list;
foreach my $recall (@recalls){
my $recalls = Koha::Recalls->search({ status => 'R' });
while( my $recall = $recalls->next ) {
if ( $recall->should_be_overdue ){
$recall->set_overdue({ interface => 'COMMANDLINE' });
}