@@ -, +, @@ --- Koha/BackgroundJob.pm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) --- a/Koha/BackgroundJob.pm +++ a/Koha/BackgroundJob.pm @@ -24,8 +24,6 @@ use Try::Tiny qw( catch try ); use C4::Context; use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions; -use Koha::BackgroundJob::BatchUpdateBiblio; -use Koha::BackgroundJob::BatchUpdateAuthority; use base qw( Koha::Object ); @@ -151,11 +149,16 @@ sub process { my ( $self, $args ) = @_; my $job_type = $self->type; - return $job_type eq 'batch_biblio_record_modification' - ? Koha::BackgroundJob::BatchUpdateBiblio->process($args) - : $job_type eq 'batch_authority_record_modification' - ? Koha::BackgroundJob::BatchUpdateAuthority->process($args) - : Koha::Exceptions::Exception->throw('->process called without valid job_type'); + + if ( $job_type eq 'batch_biblio_record_modification' ) { + require Koha::BackgroundJob::BatchUpdateBiblio; + Koha::BackgroundJob::BatchUpdateBiblio->process($args) + } elsif ( $job_type eq 'batch_authority_record_modification' ) { + require Koha::BackgroundJob::BatchUpdateAuthority; + Koha::BackgroundJob::BatchUpdateAuthority->process($args) + } else { + Koha::Exceptions::Exception->throw('->process called without valid job_type'); + } } =head3 job_type --