From b4f1cd3ce9f3c26e55403ec0fe6349fbd08e93db Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 28 Nov 2022 09:33:40 +0100 Subject: [PATCH] Bug 32305: Don't process a job if its status is not 'new' --- Koha/BackgroundJob.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm index 727bc3b2f7b..341fbfcc87d 100644 --- a/Koha/BackgroundJob.pm +++ b/Koha/BackgroundJob.pm @@ -164,6 +164,13 @@ sub process { return {} if ref($self) ne 'Koha::BackgroundJob'; + if ( $self->status ne 'new' ) { + Koha::Logger->get->warn( + sprintf "This background job has been processed already, or is not waiting to be processed (%s - %s)", + $self->id, $self->status + ); + return; + } my $derived_class = $self->_derived_class; $args ||= {}; -- 2.25.1