Bugzilla – Attachment 121274 Details for
Bug 28413
background job worker is running with all the modules in RAM
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28413: Reduce background job worker memory footprint
Bug-28413-Reduce-background-job-worker-memory-foot.patch (text/plain), 1.79 KB, created by
Jonathan Druart
on 2021-05-21 12:10:10 UTC
(
hide
)
Description:
Bug 28413: Reduce background job worker memory footprint
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-05-21 12:10:10 UTC
Size:
1.79 KB
patch
obsolete
>From 9cf3565b986903d1618351a5bb88c623e44a7fd0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >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). >--- > Koha/BackgroundJob.pm | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) > >diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm >index 09139bdbdd0..aa8cc52fd68 100644 >--- a/Koha/BackgroundJob.pm >+++ b/Koha/BackgroundJob.pm >@@ -24,8 +24,6 @@ use Try::Tiny; > 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 >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28413
:
121274
|
125392
|
125941
|
127081
|
127329
|
127598