]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiBlob.pm
No ext_urls
[public-inbox.git] / lib / PublicInbox / LeiBlob.pm
index 21003894026099d55637684cf880ed291222cd11..1692289c5e27ac932fe54b1bda90ea2be04c38b2 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 
 # "lei blob $OID" command
@@ -32,7 +32,7 @@ sub solver_user_cb { # called by solver when done
        my $lei = $self->{lei};
        my $log_buf = delete $lei->{'log_buf'};
        $$log_buf =~ s/^/# /sgm;
-       ref($res) eq 'ARRAY' or return $lei->child_error(1 << 8, $$log_buf);
+       ref($res) eq 'ARRAY' or return $lei->child_error(0, $$log_buf);
        $lei->qerr($$log_buf);
        my ($git, $oid, $type, $size, $di) = @$res;
        my $gd = $git->{git_dir};
@@ -40,7 +40,7 @@ sub solver_user_cb { # called by solver when done
        # don't try to support all the git-show(1) options for non-blob,
        # this is just a convenience:
        $type ne 'blob' and
-               $lei->err("# $oid is a $type of $size bytes in:\n#\t$gd");
+               warn "# $oid is a $type of $size bytes in:\n#\t$gd\n";
 
        my $cmd = [ 'git', "--git-dir=$gd", 'show', $oid ];
        my $rdr = { 1 => $lei->{1}, 2 => $lei->{2} };
@@ -70,10 +70,9 @@ sub do_solve_blob { # via wq_do
                        } @$git_dirs ],
                user_cb => \&solver_user_cb,
                uarg => $self,
-               # -cur_di, -qsp, -msg => temporary fields for Qspawn callbacks
+               # -cur_di, -msg => temporary fields for Qspawn callbacks
                inboxes => [ $self->{lxs}->locals, @rmt ],
        }, 'PublicInbox::SolverGit';
-       $lei->{env}->{'psgi.errors'} = $lei->{2}; # ugh...
        local $PublicInbox::DS::in_loop = 0; # waitpid synchronously
        $solver->solve($lei->{env}, $log, $self->{oid_b}, $hints);
 }
@@ -167,7 +166,7 @@ sub lei_blob {
        my ($op_c, $ops) = $lei->workers_start($self, 1);
        $lei->{wq1} = $self;
        $self->wq_io_do('do_solve_blob', []);
-       $self->wq_close(1);
+       $self->wq_close;
        $lei->wait_wq_events($op_c, $ops);
 }