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.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 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 B7D091FA10 for ; Sun, 17 Oct 2021 09:52:50 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 4/4] extindex: better locations for {quit} checks Date: Sat, 16 Oct 2021 22:52:50 -1100 Message-Id: <20211017095250.22252-5-e@80x24.org> In-Reply-To: <20211017095250.22252-1-e@80x24.org> References: <20211017095250.22252-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Check for graceful termination at every message since it's a fairly inexpensive check. --- lib/PublicInbox/ExtSearchIdx.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm index cb5256a2c562..f479cf9e1a3f 100644 --- a/lib/PublicInbox/ExtSearchIdx.pm +++ b/lib/PublicInbox/ExtSearchIdx.pm @@ -908,10 +908,9 @@ ibx_id = ? AND xnum >= ? AND xnum <= ? for my $num (@$docids) { $self->{oidx}->eidxq_add($num); } - return if $sync->{quit}; } + return if $sync->{quit}; } - return if $sync->{quit}; next unless scalar keys %x3m; $self->git->async_wait_all; # wait for reindex_unseen @@ -936,6 +935,7 @@ BUG: (non-fatal) $ekey #$xnum $smsg->{blob} still matches (old exp: $exp) for my $i (@$docids) { _unref_doc($sync, $i, $ibx, $xnum, $bin); } + return if $sync->{quit}; } } defined($hi) and ($hi < $max) and