diff options
author | Eric Wong <e@80x24.org> | 2021-09-02 10:17:56 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-09-02 10:18:36 +0000 |
commit | 44917fdd24a8bec1125caa21949476f97d8658d4 (patch) | |
tree | 7bec8992780e589bca44b111d06452f1a7c7ae4c /lib/PublicInbox/LeiStore.pm | |
parent | 3f27381a79782be136ae8d27c8f585edbbc6f6bf (diff) | |
download | public-inbox-44917fdd24a8bec1125caa21949476f97d8658d4.tar.gz |
For lei-index to work in parallel with MUA access and upcoming inotify-based updates, mail_sync.sqlite3 needs to always be up-to-date to read-only worker processes (ahead of everything else). So rely on the default auto-commit behavior and hope SQLite WAL can reduce some of the overheads involved with writes.
Diffstat (limited to 'lib/PublicInbox/LeiStore.pm')
-rw-r--r-- | lib/PublicInbox/LeiStore.pm | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm index ab39043e..6c557d99 100644 --- a/lib/PublicInbox/LeiStore.pm +++ b/lib/PublicInbox/LeiStore.pm @@ -202,7 +202,7 @@ sub _lms_rw ($) { require PublicInbox::LeiMailSync; my $f = "$self->{priv_eidx}->{topdir}/mail_sync.sqlite3"; my $lms = PublicInbox::LeiMailSync->new($f); - $lms->lms_begin; + $lms->lms_write_prepare; $lms; }; } @@ -450,9 +450,7 @@ sub checkpoint { if (my $im = $self->{im}) { $wait ? $im->barrier : $im->checkpoint; } - if (my $lms = delete $self->{lms}) { - $lms->lms_commit; - } + delete $self->{lms}; $self->{priv_eidx}->checkpoint($wait); } @@ -481,9 +479,7 @@ sub done { warn $err; } } - if (my $lms = delete $self->{lms}) { - $lms->lms_commit; - } + delete $self->{lms}; $self->{priv_eidx}->done; # V2Writable::done xchg_stderr($self); die $err if $err; |