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/LeiForgetMailSync.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/LeiForgetMailSync.pm')
-rw-r--r-- | lib/PublicInbox/LeiForgetMailSync.pm | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/PublicInbox/LeiForgetMailSync.pm b/lib/PublicInbox/LeiForgetMailSync.pm index 2b4e58a9..701f48d2 100644 --- a/lib/PublicInbox/LeiForgetMailSync.pm +++ b/lib/PublicInbox/LeiForgetMailSync.pm @@ -15,13 +15,11 @@ use PublicInbox::LeiExportKw; sub lei_forget_mail_sync { my ($lei, @folders) = @_; my $lms = $lei->lms or return; - my $sto = $lei->_lei_store or return; # may disappear due to race - $sto->write_prepare($lei); + $lms->lms_write_prepare; my $err = $lms->arg2folder($lei, \@folders); $lei->qerr(@{$err->{qerr}}) if $err->{qerr}; return $lei->fail($err->{fail}) if $err->{fail}; - $sto->ipc_do('lms_forget_folders', @folders); - $lei->sto_done_request; + $lms->forget_folders(@folders); } *_complete_forget_mail_sync = \&PublicInbox::LeiExportKw::_complete_export_kw; |