diff options
author | Eric Wong <e@80x24.org> | 2021-06-02 10:03:25 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-06-02 19:35:58 +0000 |
commit | 6ff03ba2be9247f1ead26c2524fadc789de558f1 (patch) | |
tree | 7aefda5033baae531d7fb05c647bb19a6e49bcad /lib/PublicInbox/LeiStore.pm | |
parent | 8a583e41f8b91c3e7277743d35fd792b35d5a96b (diff) | |
download | public-inbox-6ff03ba2be9247f1ead26c2524fadc789de558f1.tar.gz |
Only the lei/store process should be writing to files/DBs in lei/store.
Diffstat (limited to 'lib/PublicInbox/LeiStore.pm')
-rw-r--r-- | lib/PublicInbox/LeiStore.pm | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm index 6888afb4..821782b9 100644 --- a/lib/PublicInbox/LeiStore.pm +++ b/lib/PublicInbox/LeiStore.pm @@ -193,15 +193,30 @@ sub remove_eml_vmd { # remove just the VMD \@docids; } -sub set_sync_info { - my ($self, $oidhex, $folder, $id) = @_; - ($self->{lms} //= do { +sub _lms_rw ($) { + my ($self) = @_; + $self->{lms} //= do { require PublicInbox::LeiMailSync; my $f = "$self->{priv_eidx}->{topdir}/mail_sync.sqlite3"; my $lms = PublicInbox::LeiMailSync->new($f); $lms->lms_begin; $lms; - })->set_src($oidhex, $folder, $id); + }; +} + +sub lms_clear_src { + my ($self, $folder, $id) = @_; + _lms_rw($self)->clear_src($folder, $id); +} + +sub lms_mv_src { + my ($self, $folder, $oidbin, $id, $newbn) = @_; + _lms_rw($self)->mv_src($folder, $oidbin, $id, $newbn); +} + +sub set_sync_info { + my ($self, $oidhex, $folder, $id) = @_; + _lms_rw($self)->set_src($oidhex, $folder, $id); } sub _remove_if_local { # git->cat_async arg |