From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 9CEE61F461 for ; Fri, 12 Apr 2024 18:04:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1712945054; bh=FuxjP0quMTBsATmOcMKoR0bIdftKi7NL0zNa8NHsguU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qy3oJS5k6zpWYFIN3JEjEvM6R+G4Ukz+/GBm7hd6V0FWzfSDSt7WRllGZFQZpLxP7 2buaA3I5qr3FrnvBddV9H9uOteUofWlE+UunYCBxJBGHthZpfXj5pY5PA74qyZk1NI bc3nX/2Ozr4CezPfmDV3VOj8HHbVEEyDxW8vOxOM= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/3] lei_remote: solver supports uncommitted blobs Date: Fri, 12 Apr 2024 18:04:12 +0000 Message-ID: <20240412180414.2785898-2-e@80x24.org> In-Reply-To: <20240412180414.2785898-1-e@80x24.org> References: <20240412180414.2785898-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This should improve `lei blob' and `lei rediff' functionality for folks relying on `lei index' and allows future work to improve parallelism via checkpointing in lei/store. --- lib/PublicInbox/LeiRemote.pm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/LeiRemote.pm b/lib/PublicInbox/LeiRemote.pm index 559fb8d5..ddcaf2c9 100644 --- a/lib/PublicInbox/LeiRemote.pm +++ b/lib/PublicInbox/LeiRemote.pm @@ -67,9 +67,16 @@ sub base_url { "$_[0]->{uri}" } sub smsg_eml { my ($self, $smsg) = @_; - if (my $bref = $self->{lei}->ale->git->cat_file($smsg->{blob})) { - return PublicInbox::Eml->new($bref); - } + my $bref = $self->{lei}->ale->git->cat_file($smsg->{blob}) // do { + my $lms = $self->{lei}->lms; + ($lms ? $lms->local_blob($smsg->{blob}, 1) : undef) // do { + my $sto = $self->{lei}->{sto} // + $self->{lei}->_lei_store; + $sto && $sto->{-wq_s1} ? + $sto->wq_do('cat_blob', $smsg->{blob}) : undef; + } + }; + return PublicInbox::Eml->new($bref) if $bref; warn("E: $self->{uri} $smsg->{blob} gone <$smsg->{mid}>\n"); undef; }