From c86e6ee82d27640c5c66c534d1e93ddbbbc2c4fa 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 --- 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