From c8b25caf877fb83df2ea77f277777d702bebf597 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 21 May 2021 11:57:20 +0200 Subject: [PATCH] Bug 28413: Reduce background job worker memory footprint It's loading the modules in RAM then forks. Then do not need it to have them loaded in the parent process (the worker/daemon). Signed-off-by: Martin Renvoize --- Koha/BackgroundJob.pm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm index c5cfd90899e..cb8a71fb046 100644 --- a/Koha/BackgroundJob.pm +++ b/Koha/BackgroundJob.pm @@ -25,13 +25,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 Koha::BackgroundJob::BatchUpdateItem; -use Koha::BackgroundJob::BatchDeleteBiblio; -use Koha::BackgroundJob::BatchDeleteAuthority; -use Koha::BackgroundJob::BatchDeleteItem; -use Koha::BackgroundJob::BatchCancelHold; use base qw( Koha::Object ); @@ -246,6 +239,7 @@ sub _derived_class { Koha::Exceptions::Exception->throw($job_type . ' is not a valid job_type') unless $class; + eval "require $class"; return $class->new; } -- 2.25.1