diff options
author | Eric Wong <e@80x24.org> | 2021-09-18 09:33:25 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-09-18 20:25:27 +0000 |
commit | 47d4e53734820b4e5a2f6cfa29056329e387ef22 (patch) | |
tree | 78328c0d68e3e329fa8c57c3300f8273bc122b89 /lib/PublicInbox/LeiToMail.pm | |
parent | 7b7939d47b336fb7d8c4387858e620dbc218bb1e (diff) | |
download | public-inbox-47d4e53734820b4e5a2f6cfa29056329e387ef22.tar.gz |
Since 44917fdd24a8bec1 ("lei_mail_sync: do not use transactions"), relying on lei/store to serialize access was a pointless endeavor. Rely on flock(2) to serialize multiple writers since (in my experience) it's the easiest way to deal with parallel writers when using SQLite. This allows us to simplify existing callers while speeding up 'lei refresh-mail-sync --all=local' by 5% or so.
Diffstat (limited to 'lib/PublicInbox/LeiToMail.pm')
-rw-r--r-- | lib/PublicInbox/LeiToMail.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm index 15729bda..d3253d9b 100644 --- a/lib/PublicInbox/LeiToMail.pm +++ b/lib/PublicInbox/LeiToMail.pm @@ -458,8 +458,10 @@ sub _pre_augment_maildir { sub clobber_dst_prepare ($;$) { my ($lei, $f) = @_; - my $wait = (defined($f) && $lei->{sto}) ? - $lei->{sto}->ipc_do('lms_forget_folders', $f) : undef; + if (my $lms = defined($f) ? $lei->lms : undef) { + $lms->lms_write_prepare; + $lms->forget_folders($f); + } my $dedupe = $lei->{dedupe} or return; $dedupe->reset_dedupe if $dedupe->can('reset_dedupe'); } |