Bugzilla – Attachment 169555 Details for
Bug 36736
Add ability to load DBIx::Class Schema files found in plugins
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36736: Load plugins at the start of background job processing
Bug-36736-Load-plugins-at-the-start-of-background-.patch (text/plain), 1.88 KB, created by
Tomás Cohen Arazi
on 2024-07-25 13:32:57 UTC
(
hide
)
Description:
Bug 36736: Load plugins at the start of background job processing
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2024-07-25 13:32:57 UTC
Size:
1.88 KB
patch
obsolete
>From 3c5fd9c5498bdcaa919826ee1a3d5f6cb51a7e15 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 11 Jul 2024 18:08:08 +0000 >Subject: [PATCH] Bug 36736: Load plugins at the start of background job > processing > >This patch adds a call to get_enabled_plugins before processing background jobs to ensure >that all plugin hooks are loaded and cached > >To test: >1 - Install a plugin that adds new objects e.g. the Contracts plugin > https://github.com/bywatersolutions/fs-koha-plugin-contracts > or the Koha Advent plugin: > https://gitlab.com/koha-community/koha-advent/koha-plugin-fancyplugin >2 - Restart all >3 - Tail all your logs >4 - Stage and import a file containing items >5 - Note in the logs > DBI Exception: DBD::mysql::st execute failed: Lock wait timeout exceeded; try restarting transaction >6 - Apply this patch >7 - Restart all >8 - Stage and import again >9 - Success! > >Signed-off-by: David Cook <dcook@prosentient.com.au> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/BackgroundJob.pm | 7 +++++++ > 1 file changed, 7 insertions(+) > >diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm >index 4525122e8c3..33a6872ec03 100644 >--- a/Koha/BackgroundJob.pm >+++ b/Koha/BackgroundJob.pm >@@ -26,6 +26,7 @@ use C4::Context; > use Koha::DateUtils qw( dt_from_string ); > use Koha::Exceptions; > use Koha::Exceptions::BackgroundJob; >+use Koha::Plugins; > > use base qw( Koha::Object ); > >@@ -164,6 +165,12 @@ sub process { > > return {} if ref($self) ne 'Koha::BackgroundJob'; > >+ # Our background jobs are called in forked processes >+ # to ensure we have all plugin hooks and data we call >+ # get_enabled_plugins at the star of processing >+ # to populate the cache >+ Koha::Plugins->get_enabled_plugins(); >+ > my $derived_class = $self->_derived_class; > > $args ||= {}; >-- >2.45.2
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 36736
:
168861
|
169389
|
169410
|
169440
|
169508
| 169555