about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-08-17 09:33:16 +0000
committerEric Wong <e@80x24.org>2022-08-18 07:21:48 +0000
commita8ab1ced5ad9efc4ca0b772e0f89c6a2c08229dd (patch)
tree971fd7ef87542141de6c65f27901fb393a1d973f
parentea75b0db2bb439acdcd1d6e00a7bb76d96044f38 (diff)
downloadpublic-inbox-a8ab1ced5ad9efc4ca0b772e0f89c6a2c08229dd.tar.gz
There's no need to initialize eidx if we already have an open
handle for mail_sync.sqlite3
-rw-r--r--lib/PublicInbox/LeiStore.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm
index 66049dfe..d49746cb 100644
--- a/lib/PublicInbox/LeiStore.pm
+++ b/lib/PublicInbox/LeiStore.pm
@@ -255,13 +255,13 @@ sub remove_eml_vmd { # remove just the VMD
 
 sub _lms_rw ($) { # it is important to have eidx processes open before lms
         my ($self) = @_;
-        my ($eidx, $tl) = eidx_init($self);
-        $self->{lms} //= do {
+        $self->{lms} // do {
                 require PublicInbox::LeiMailSync;
+                my ($eidx, $tl) = eidx_init($self);
                 my $f = "$self->{priv_eidx}->{topdir}/mail_sync.sqlite3";
                 my $lms = PublicInbox::LeiMailSync->new($f);
                 $lms->lms_write_prepare;
-                $lms;
+                $self->{lms} = $lms;
         };
 }