about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiMailSync.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-09-02 10:17:56 +0000
committerEric Wong <e@80x24.org>2021-09-02 10:18:36 +0000
commit44917fdd24a8bec1125caa21949476f97d8658d4 (patch)
tree7bec8992780e589bca44b111d06452f1a7c7ae4c /lib/PublicInbox/LeiMailSync.pm
parent3f27381a79782be136ae8d27c8f585edbbc6f6bf (diff)
downloadpublic-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/LeiMailSync.pm')
-rw-r--r--lib/PublicInbox/LeiMailSync.pm14
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/PublicInbox/LeiMailSync.pm b/lib/PublicInbox/LeiMailSync.pm
index f8834a27..5a10c127 100644
--- a/lib/PublicInbox/LeiMailSync.pm
+++ b/lib/PublicInbox/LeiMailSync.pm
@@ -32,9 +32,7 @@ sub new {
         bless { filename => $f, fmap => {} }, $cls;
 }
 
-sub lms_commit { delete($_[0]->{dbh})->commit }
-
-sub lms_begin { ($_[0]->{dbh} //= dbh_new($_[0], 1))->begin_work };
+sub lms_write_prepare { ($_[0]->{dbh} //= dbh_new($_[0], 1)) };
 
 sub create_tables {
         my ($dbh) = @_;
@@ -468,14 +466,4 @@ sub imap_oid {
         $oidbin ? unpack('H*', $oidbin) : undef;
 }
 
-# FIXED? something with "lei <up|q>" is causing uncommitted transaction
-# TODO: remove soon
-sub DESTROY {
-        my ($self) = @_;
-        my $dbh = delete($self->{dbh}) or return;
-        return if $dbh->{ReadOnly};
-        undef $dbh;
-        warn "BUG $$ $0 $self {dbh} OPEN ppid=".getppid.' '.Carp::longmess();
-}
-
 1;