From 16ecdc2f8edfcdc77214751caa049e46b237184c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 4 Jan 2023 10:08:06 +0100 Subject: [PATCH] Bug 32561: Prevent worker to run with unecessary modules in memory Regression of bug 28413, bug 30410 added a "use Koha::Plugins" statement at the top of Koha::BackgroundJob, and so all Koha module are loaded by the worker on startup. See bug 28413 for more info Signed-off-by: Kyle M Hall Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi (cherry picked from commit a85a6bc4d4a1c15a065dc8b188d6de0c23f99271) Signed-off-by: Matt Blenkinsop --- Koha/BackgroundJob.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm index 727bc3b2f7..0ba7ba46ed 100644 --- a/Koha/BackgroundJob.pm +++ b/Koha/BackgroundJob.pm @@ -25,7 +25,6 @@ use Try::Tiny qw( catch try ); use C4::Context; use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions; -use Koha::Plugins; use Koha::Exceptions::BackgroundJob; use base qw( Koha::Object ); @@ -442,6 +441,7 @@ sub plugin_types_to_classes { my ($self) = @_; unless ( exists $self->{_plugin_mapping} ) { + require Koha::Plugins; my @plugins = Koha::Plugins->new()->GetPlugins( { method => 'background_tasks', } ); foreach my $plugin (@plugins) { -- 2.39.5