From bd0d8b3139bd20398fab84a861f8641667b210f5 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 2 Mar 2022 15:24:46 +0000 Subject: [PATCH] Bug 19532: (QA follow-up) Move as_list to iterator based loop Content-Type: text/plain; charset=utf-8 Adjusting both new cron jobs. Signed-off-by: Marcel de Rooy --- misc/cronjobs/recalls/expire_recalls.pl | 4 ++-- misc/cronjobs/recalls/overdue_recalls.pl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/misc/cronjobs/recalls/expire_recalls.pl b/misc/cronjobs/recalls/expire_recalls.pl index 4e4ee006eb..7da4fdcd41 100755 --- a/misc/cronjobs/recalls/expire_recalls.pl +++ b/misc/cronjobs/recalls/expire_recalls.pl @@ -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' }); diff --git a/misc/cronjobs/recalls/overdue_recalls.pl b/misc/cronjobs/recalls/overdue_recalls.pl index 4910335536..d0e60859b4 100755 --- a/misc/cronjobs/recalls/overdue_recalls.pl +++ b/misc/cronjobs/recalls/overdue_recalls.pl @@ -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' }); } -- 2.20.1