From 34b264a3d7ee65b9a6ba198b3e45b8caedfe5327 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 5 Feb 2024 11:13:15 +0000 Subject: [PATCH] Bug 35819: (QA follow-up) Prevent warning on uninitialized retries count Content-Type: text/plain; charset=utf-8 Signed-off-by: Marcel de Rooy --- misc/workers/background_jobs_worker.pl | 3 ++- misc/workers/es_indexer_daemon.pl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/misc/workers/background_jobs_worker.pl b/misc/workers/background_jobs_worker.pl index 94c458268c..e34ec54f25 100755 --- a/misc/workers/background_jobs_worker.pl +++ b/misc/workers/background_jobs_worker.pl @@ -145,7 +145,8 @@ while (1) { } unless ($job) { - if ( ++$not_found_retries->{$args->{job_id}} >= $max_retries ) { + $not_found_retries->{ $args->{job_id} } //= 0; + if ( ++$not_found_retries->{ $args->{job_id} } >= $max_retries ) { Koha::Logger->get( { interface => 'worker' } ) ->warn( sprintf "Job %s not found, no more retry", $args->{job_id} ); diff --git a/misc/workers/es_indexer_daemon.pl b/misc/workers/es_indexer_daemon.pl index 5f34345391..9e900b7195 100755 --- a/misc/workers/es_indexer_daemon.pl +++ b/misc/workers/es_indexer_daemon.pl @@ -143,7 +143,8 @@ while (1) { } unless ($job) { - if ( ++$not_found_retries->{$args->{job_id}} >= $max_retries ) { + $not_found_retries->{ $args->{job_id} } //= 0; + if ( ++$not_found_retries->{ $args->{job_id} } >= $max_retries ) { Koha::Logger->get( { interface => 'worker' } ) ->warn( sprintf "Job %s not found, no more retry", $args->{job_id} ); -- 2.30.2