Lines 26-31
use Module::Load::Conditional qw( can_load );
Link Here
|
26 |
use Module::Load; |
26 |
use Module::Load; |
27 |
use Module::Pluggable search_path => ['Koha::Plugin'], except => qr/::Edifact(|::Line|::Message|::Order|::Segment|::Transport)$/; |
27 |
use Module::Pluggable search_path => ['Koha::Plugin'], except => qr/::Edifact(|::Line|::Message|::Order|::Segment|::Transport)$/; |
28 |
use Try::Tiny; |
28 |
use Try::Tiny; |
|
|
29 |
use POSIX qw(getpid); |
29 |
|
30 |
|
30 |
use C4::Context; |
31 |
use C4::Context; |
31 |
use C4::Output; |
32 |
use C4::Output; |
Lines 312-317
sub InstallPlugins {
Link Here
|
312 |
|
313 |
|
313 |
Koha::Cache::Memory::Lite->clear_from_cache(ENABLED_PLUGINS_CACHE_KEY); |
314 |
Koha::Cache::Memory::Lite->clear_from_cache(ENABLED_PLUGINS_CACHE_KEY); |
314 |
|
315 |
|
|
|
316 |
$self->_restart_after_change(); |
317 |
|
315 |
return @plugins; |
318 |
return @plugins; |
316 |
} |
319 |
} |
317 |
|
320 |
|
Lines 354-359
sub RemovePlugins {
Link Here
|
354 |
Koha::Plugins::Datas->search($cond)->update( { plugin_value => 0 } ); |
357 |
Koha::Plugins::Datas->search($cond)->update( { plugin_value => 0 } ); |
355 |
Koha::Cache::Memory::Lite->clear_from_cache( Koha::Plugins->ENABLED_PLUGINS_CACHE_KEY ); |
358 |
Koha::Cache::Memory::Lite->clear_from_cache( Koha::Plugins->ENABLED_PLUGINS_CACHE_KEY ); |
356 |
} |
359 |
} |
|
|
360 |
|
361 |
$class->_restart_after_change(); |
362 |
} |
363 |
|
364 |
sub _restart_after_change { |
365 |
my ( $class, $params ) = @_; |
366 |
|
367 |
my $parent_pid = getpid(); |
368 |
my $ppid = getppid(); # Get the parent process ID |
369 |
|
370 |
# If the current process is not Plack parent, find the parent process recursively |
371 |
while ($parent_pid != $ppid) { |
372 |
$parent_pid = $ppid; |
373 |
$ppid = getppid(); |
374 |
} |
375 |
|
376 |
# Send SIGUSR1 signal to Plack parent process for graceful restart |
377 |
kill 'HUP', $parent_pid; |
357 |
} |
378 |
} |
358 |
|
379 |
|
359 |
1; |
380 |
1; |
360 |
- |
|
|