From fe565af9e3e1634412c21fb2fe2bb7612c430e47 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 15 Nov 2019 09:50:39 +0000 Subject: inboxwritable: add ->cleanup method We've been using this in -edit, and will be using it in some more scripts and tests to optimize for run_mode=2 with run_script. Keeping this in the *Writable modules since I don't see it being useful for the WWW and NNTP read-only interfaces which use PublicInbox::Inbox. --- lib/PublicInbox/InboxWritable.pm | 4 ++++ lib/PublicInbox/Xapcmd.pm | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/PublicInbox/InboxWritable.pm b/lib/PublicInbox/InboxWritable.pm index c73910ac..d8391251 100644 --- a/lib/PublicInbox/InboxWritable.pm +++ b/lib/PublicInbox/InboxWritable.pm @@ -257,4 +257,8 @@ sub umask_prepare { $self->{umask} = $umask; } +sub cleanup ($) { + delete @{$_[0]}{qw(over mm git search)}; +} + 1; diff --git a/lib/PublicInbox/Xapcmd.pm b/lib/PublicInbox/Xapcmd.pm index c807bf10..77f0524e 100644 --- a/lib/PublicInbox/Xapcmd.pm +++ b/lib/PublicInbox/Xapcmd.pm @@ -234,7 +234,7 @@ sub run { $im->lock_release; } - delete($ibx->{$_}) for (qw(mm over search)); # cleanup + $ibx->cleanup; process_queue(\@q, $cb, $max, $opt); $im->lock_acquire if !$opt->{-coarse_lock}; commit_changes($ibx, $im, $tmp, $opt); -- cgit v1.2.3-24-ge0c7