about summary refs log tree commit homepage
path: root/lib/PublicInbox/IPC.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/IPC.pm')
-rw-r--r--lib/PublicInbox/IPC.pm5
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