]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiMailSync.pm
lei_mail_sync: do not use transactions
[public-inbox.git] / lib / PublicInbox / LeiMailSync.pm
index f8834a27720145e0d4f3a09bd47919a0d5cc96a2..5a10c127c1f8e2db1c080f20530ed90385c3d461 100644 (file)
@@ -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;