about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiXSearch.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-11-02 09:35:30 +0000
committerEric Wong <e@80x24.org>2023-11-03 06:39:28 +0000
commitd3c55d072839286efb2865fe20f2324a9e595e95 (patch)
treec3a7b450e22a0e9d7e849d53884f6af8af19cee5 /lib/PublicInbox/LeiXSearch.pm
parent19f9089343c9e579253db756f2131ee493718ead (diff)
downloadpublic-inbox-d3c55d072839286efb2865fe20f2324a9e595e95.tar.gz
treewide: use ->close to call ProcessIO->CLOSE
This will open the door for us to drop `tie' usage from
ProcessIO completely in favor of OO method dispatch.  While
OO method dispatches (e.g. `$fh->close') are slower than normal
subroutine calls, it hardly matters in this case since process
teardown is a fairly rare operation and we continue to use
`close($fh)' for Maildir writes.
Diffstat (limited to 'lib/PublicInbox/LeiXSearch.pm')
-rw-r--r--lib/PublicInbox/LeiXSearch.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm
index 241b9dab..5443188d 100644
--- a/lib/PublicInbox/LeiXSearch.pm
+++ b/lib/PublicInbox/LeiXSearch.pm
@@ -353,14 +353,14 @@ print STDERR $_;
                                                 $lei, $each_smsg);
                 $lei->sto_done_request if delete($self->{-sto_imported});
                 my $nr = delete $lei->{-nr_remote_eml} // 0;
-                close $cfh;
+                $cfh->close;
                 my $code = $?;
                 if (!$code) { # don't update if no results, maybe MTA is down
                         $lei->{lss}->cfg_set($key, $start) if $key && $nr;
                         mset_progress($lei, $lei->{-current_url}, $nr, $nr);
                         next;
                 }
-                close(delete($rdr->{2})) if @lbf_tee;
+                delete($rdr->{2})->close if @lbf_tee;
                 seek($cerr, 0, SEEK_SET);
                 read($cerr, my $err, -s $cerr);
                 truncate($cerr, 0);
@@ -396,8 +396,8 @@ sub query_done { # EOF callback for main daemon
         $lei->{ovv}->ovv_end($lei);
         if ($l2m) { # close() calls LeiToMail reap_compress
                 if (my $out = delete $lei->{old_1}) {
-                        if (my $mbout = $lei->{1}) {
-                                close($mbout) or die <<"";
+                        if (my $mbout = $lei->{1}) { # compressor pipe process
+                                $mbout->close or die <<"";
 Error closing $lei->{ovv}->{dst}: \$!=$! \$?=$?
 
                         }