]> Sergey Matveev's repositories - public-inbox.git/commitdiff
extindex: better locations for {quit} checks
authorEric Wong <e@80x24.org>
Sun, 17 Oct 2021 09:52:50 +0000 (22:52 -1100)
committerEric Wong <e@80x24.org>
Sun, 17 Oct 2021 19:04:49 +0000 (19:04 +0000)
Check for graceful termination at every message since it's
a fairly inexpensive check.

lib/PublicInbox/ExtSearchIdx.pm

index cb5256a2c5625826b90d6aea26e75bf5863aeef9..f479cf9e1a3fd4ee42ff9e03eeba26b26c1b1411 100644 (file)
@@ -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