diff options
author | Eric Wong <e@80x24.org> | 2021-03-28 09:01:13 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-03-28 23:01:36 +0000 |
commit | 954581b8e575966a8bddc35e3b23d81d16a52833 (patch) | |
tree | d5e87f75313f827411796d82871fd6b1d5388e9c /lib/PublicInbox/LeiXSearch.pm | |
parent | 29792d70a5d8305f68521664a7fa2e0fe54ff291 (diff) | |
download | public-inbox-954581b8e575966a8bddc35e3b23d81d16a52833.tar.gz |
Provide a consistent ->op_wait_event method instead of forcing callers to loop (or not) at each callsite. This also avoid a leak possibility by avoiding circular references.
Diffstat (limited to 'lib/PublicInbox/LeiXSearch.pm')
-rw-r--r-- | lib/PublicInbox/LeiXSearch.pm | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index b41daffe..1a194f1c 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -427,7 +427,7 @@ sub do_query { 'incr_start_query' => [ \&incr_start_query, $self, $l2m ], }; $lei->{auth}->op_merge($ops, $l2m) if $l2m && $lei->{auth}; - my $end = $lei->pkt_op_pair($ops); + my $end = $lei->pkt_op_pair; $lei->{1}->autoflush(1); $lei->start_pager if delete $lei->{need_pager}; $lei->{ovv}->ovv_begin($lei); @@ -445,7 +445,7 @@ sub do_query { } $self->wq_workers_start('lei_xsearch', undef, $lei->oldset, { lei => $lei }); - my $op = delete $lei->{pkt_op_c}; + my $op_c = delete $lei->{pkt_op_c}; delete $lei->{pkt_op_p}; @$end = (); $self->{threads} = $lei->{opt}->{threads}; @@ -455,9 +455,7 @@ sub do_query { start_query($self); } $lei->event_step_init; # wait for shutdowns - if ($lei->{oneshot}) { - while ($op->{sock}) { $op->event_step } - } + $op_c->op_wait_event($ops); } sub add_uri { |