From 17032f89a35715f143529ea128580c33ac952350 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 Signed-off-by: Marcel de Rooy Signed-off-by: Katrin Fischer (cherry picked from commit c86e6ee82d27640c5c66c534d1e93ddbbbc2c4fa) Signed-off-by: Fridolin Somers --- 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 d319c12a94..823dbab15c 100755 --- a/misc/workers/background_jobs_worker.pl +++ b/misc/workers/background_jobs_worker.pl @@ -146,7 +146,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.39.5