X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FLeiXSearch.pm;h=5965274ca211396df49e263ec6ade1508e3ba458;hb=refs%2Fheads%2Fmaster;hp=730df1f772f12da20821b3546e4e459b57419689;hpb=7f70bf3c6aab60f494842504e1267e719515430b;p=public-inbox.git diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 730df1f7..5965274c 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -400,9 +400,8 @@ sub query_remote_mboxrd { sub git { $_[0]->{git} // die 'BUG: git uninitialized' } -sub xsearch_done_wait { # dwaitpid callback - my ($arg, $pid) = @_; - my ($wq, $lei) = @$arg; +sub xsearch_done_wait { # awaitpid cb + my ($pid, $wq, $lei) = @_; return if !$?; my $s = $? & 127; return $lei->child_error($?) if $s == 13 || $s == 15; @@ -574,15 +573,15 @@ sub do_query { $l2m->{au_peers} = [ $a_r, $a_w, $b_r, $b_w ]; } $l2m->wq_workers_start('lei2mail', undef, - $lei->oldset, { lei => $lei }); - $l2m->wq_wait_async(\&xsearch_done_wait, $lei); + $lei->oldset, { lei => $lei }, + \&xsearch_done_wait, $lei); pipe($lei->{startq}, $lei->{au_done}) or die "pipe: $!"; fcntl($lei->{startq}, $F_SETPIPE_SZ, 4096) if $F_SETPIPE_SZ; delete $l2m->{au_peers}; } $self->wq_workers_start('lei_xsearch', undef, - $lei->oldset, { lei => $lei }); - $self->wq_wait_async(\&xsearch_done_wait, $lei); + $lei->oldset, { lei => $lei }, + \&xsearch_done_wait, $lei); my $op_c = delete $lei->{pkt_op_c}; delete $lei->{pkt_op_p}; @$end = ();