diff options
author | Eric Wong <e@80x24.org> | 2021-08-17 08:52:41 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-08-18 11:41:33 +0000 |
commit | 706888be614a26b91be75d39578b9db26772bd00 (patch) | |
tree | c68446d00842eb32d519145e886c6cb1066b5fba /lib/PublicInbox/LeiForgetMailSync.pm | |
parent | 77d030df1d292a99291371b3649cff3657fd93c8 (diff) | |
download | public-inbox-706888be614a26b91be75d39578b9db26772bd00.tar.gz |
As implied in commit 6ff03ba2be9247f1 ("lei export-kw: do not write directly to mail_sync.sqlite3"), modifying mail_sync.sqlite3 directly can lead to conflicts and making everything go through lei/store is easier.
Diffstat (limited to 'lib/PublicInbox/LeiForgetMailSync.pm')
-rw-r--r-- | lib/PublicInbox/LeiForgetMailSync.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/PublicInbox/LeiForgetMailSync.pm b/lib/PublicInbox/LeiForgetMailSync.pm index c74ba25d..940ca1b6 100644 --- a/lib/PublicInbox/LeiForgetMailSync.pm +++ b/lib/PublicInbox/LeiForgetMailSync.pm @@ -15,13 +15,13 @@ 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; my $err = $lms->arg2folder($lei, \@folders); $lei->qerr(@{$err->{qerr}}) if $err->{qerr}; return $lei->fail($err->{fail}) if $err->{fail}; - delete $lms->{dbh}; - $lms->lms_begin; - $lms->forget_folder($_) for @folders; - $lms->lms_commit; + $sto->ipc_do('lms_forget_folders', @folders); + my $wait = $sto->ipc_do('done'); } *_complete_forget_mail_sync = \&PublicInbox::LeiExportKw::_complete_export_kw; |