diff options
author | Eric Wong <e@80x24.org> | 2023-11-02 09:35:38 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-11-03 06:39:44 +0000 |
commit | 8d86e5b49d7f5d6e0b1768d0bd55fd21df36f86e (patch) | |
tree | 74c292ea35d4963525327cc5f7e64dc975156fee /lib/PublicInbox/XapHelper.pm | |
parent | 3aa444b4c4eef1c40a49e5db191eb844c6624b58 (diff) | |
download | public-inbox-8d86e5b49d7f5d6e0b1768d0bd55fd21df36f86e.tar.gz |
The IO package seems like a better home for I/O subs than the Git package. We lose the 60 second read timeout for `git cat-file --batch-*' processes since it's probably not necessary given how reliable the code has proven and things would fall over hard in other ways if the storage device were completely hosed.
Diffstat (limited to 'lib/PublicInbox/XapHelper.pm')
-rw-r--r-- | lib/PublicInbox/XapHelper.pm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/PublicInbox/XapHelper.pm b/lib/PublicInbox/XapHelper.pm index 41c66a12..1ee918e3 100644 --- a/lib/PublicInbox/XapHelper.pm +++ b/lib/PublicInbox/XapHelper.pm @@ -10,7 +10,7 @@ $GLP->configure(qw(require_order bundling no_ignore_case no_auto_abbrev)); use PublicInbox::Search qw(xap_terms); use PublicInbox::CodeSearch; use PublicInbox::IPC; -use PublicInbox::Git qw(read_all); +use PublicInbox::IO qw(read_all); use Socket qw(SOL_SOCKET SO_TYPE SOCK_SEQPACKET AF_UNIX); use PublicInbox::DS qw(awaitpid); use autodie qw(open getsockopt); @@ -125,9 +125,8 @@ sub cmd_dump_roots { $req->{A} or return warn('dump_roots requires -A PREFIX'); open my $fh, '<', $root2id_file; my $root2id; # record format: $OIDHEX "\0" uint32_t - my @x = split(/\0/, read_all($fh)); - while (@x) { - my $oidhex = shift @x; + my @x = split(/\0/, read_all $fh); + while (defined(my $oidhex = shift @x)) { $root2id->{$oidhex} = shift @x; } my $opt = { relevance => -1, limit => $req->{'m'}, |