diff options
author | Eric Wong <e@80x24.org> | 2021-02-07 08:51:45 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-02-07 22:56:55 +0000 |
commit | 3894c29d99646fcd315ca6794b65e32547fcbae2 (patch) | |
tree | d4ac121975bfd3f72fe922cac605342ed8dc5efe /lib/PublicInbox/IPC.pm | |
parent | 5244475c94d9f80b0a76b6bfa9185bdff5a8a0d8 (diff) | |
download | public-inbox-3894c29d99646fcd315ca6794b65e32547fcbae2.tar.gz |
This also updates lei_xsearch to follow the same pattern for stopping curl(1) and tail(1) processes it spawns.
Diffstat (limited to 'lib/PublicInbox/IPC.pm')
-rw-r--r-- | lib/PublicInbox/IPC.pm | 5 |
1 files changed, 3 insertions, 2 deletions
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 |