about summary refs log tree commit homepage
path: root/lib/PublicInbox/ExtSearchIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-23 08:38:49 +0000
committerEric Wong <e@80x24.org>2020-12-23 23:46:41 +0000
commit6f9b927bf1fc5e84b92532477b275a45cd30cb01 (patch)
tree5a4c2066f3e81184be752be4639d8471e585dba3 /lib/PublicInbox/ExtSearchIdx.pm
parent4a2e89007cb7b62151cb1869e49b27ebacfc27eb (diff)
downloadpublic-inbox-6f9b927bf1fc5e84b92532477b275a45cd30cb01.tar.gz
This is needed to prevent us from running out of FDs when
indexing many inboxes.  Perhaps checking these on attach_inbox
is unnecessary and may be removed entirely down the line.
Diffstat (limited to 'lib/PublicInbox/ExtSearchIdx.pm')
-rw-r--r--lib/PublicInbox/ExtSearchIdx.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm
index 9d64ff5a..fb627089 100644
--- a/lib/PublicInbox/ExtSearchIdx.pm
+++ b/lib/PublicInbox/ExtSearchIdx.pm
@@ -65,11 +65,14 @@ sub attach_inbox {
         my $misc = $self->{misc};
         if ($misc && $misc->inbox_data($ibx)) { # all good if already indexed
         } else {
-                if (!$ibx->over || !$ibx->mm) {
+                my @sqlite = ($ibx->over, $ibx->mm);
+                my $uidvalidity = $ibx->uidvalidity;
+                $ibx->{mm} = $ibx->{over} = undef;
+                if (scalar(@sqlite) != 2) {
                         warn "W: skipping $ekey (unindexed)\n";
                         return;
                 }
-                if (!defined($ibx->uidvalidity)) {
+                if (!defined($uidvalidity)) {
                         warn "W: skipping $ekey (no UIDVALIDITY)\n";
                         return;
                 }