From 3894c29d99646fcd315ca6794b65e32547fcbae2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 7 Feb 2021 08:51:45 +0000 Subject: lei add-external: handle interrupts with --mirror This also updates lei_xsearch to follow the same pattern for stopping curl(1) and tail(1) processes it spawns. --- lib/PublicInbox/IPC.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/IPC.pm') diff --git a/lib/PublicInbox/IPC.pm b/lib/PublicInbox/IPC.pm index 0dee2a92..b936c27a 100644 --- a/lib/PublicInbox/IPC.pm +++ b/lib/PublicInbox/IPC.pm @@ -150,9 +150,10 @@ sub ipc_worker_reap { # dwaitpid callback } sub wq_wait_old { - my ($self, $args) = @_; + my ($self, @args) = @_; + my $cb = ref($args[0]) eq 'CODE' ? shift(@args) : \&ipc_worker_reap; my $pids = delete $self->{"-wq_old_pids.$$"} or return; - dwaitpid($_, \&ipc_worker_reap, [$self, $args]) for @$pids; + dwaitpid($_, $cb, [$self, @args]) for @$pids; } # for base class, override in sub classes -- cgit v1.2.3-24-ge0c7