From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 1124A1F4DA; Thu, 7 Jul 2022 09:40:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1657186831; bh=1VH5isRkUF7R457G+OeJwzE1UpmbzvS4rG35cc1xwDs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lJv3jz5iKVnjY66EtSKN1wyO3mK0PLpW7c/wvrKtJBw1vbZ7c0xNLurWoh+BHgqOL Di94qt974Ch+axg291UzZ9afIZgmASrwjrG7OTS1N6Un4qEDl97F79/6AJIsQj3+Np +fDJ2hQNd9fYr3eGWEqrgrZGWZ5jU0o1I5egs2lw= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/2] lei_xsearch: simplify lei/store import check Date: Thu, 7 Jul 2022 09:40:29 +0000 Message-Id: <20220707094030.1185793-2-e@80x24.org> In-Reply-To: <20220707094030.1185793-1-e@80x24.org> References: <20220707094030.1185793-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: There's no need to check for two fields when one will suffice. --- lib/PublicInbox/LeiXSearch.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 2958d3f9..41e79856 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -285,7 +285,7 @@ sub each_remote_eml { # callback for MboxReader->mboxrd my ($res, $kw) = $self->{import_sto}->wq_do('add_eml', $eml); if (ref($res) eq ref($smsg)) { # totally new message $smsg = $res; - $self->{-imported} = 1; + $self->{-sto_imported} = 1; } $smsg->{kw} = $kw; # short-circuit xsmsg_vmd } @@ -376,7 +376,7 @@ sub query_remote_mboxrd { $fh = IO::Uncompress::Gunzip->new($fh, MultiStream => 1); PublicInbox::MboxReader->mboxrd($fh, \&each_remote_eml, $self, $lei, $each_smsg); - if ($self->{import_sto} && delete($self->{-imported})) { + if (delete($self->{-sto_imported})) { my $wait = $self->{import_sto}->wq_do('done'); } $reap_curl->join;