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.
$self->{umask} = $umask;
}
+sub cleanup ($) {
+ delete @{$_[0]}{qw(over mm git search)};
+}
+
1;
$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);
my $tuple = [ $ibx, $smsg ];
push @{$found->{$cid} ||= []}, $tuple
}
- delete @$ibx{qw(over mm git search)}; # cleanup
+ PublicInbox::InboxWritable::cleanup($ibx);
}
$found;
}
my $edit_fn = $edit_fh->filename;
my ($ibx, $smsg) = @{$to_edit->[0]};
my $old_raw = $ibx->msg_by_smsg($smsg);
- delete @$ibx{qw(over mm git search)}; # cleanup
+ PublicInbox::InboxWritable::cleanup($ibx);
my $tmp = $$old_raw;
if (!$opt->{raw}) {