From 94ae705673cb03045a109041eec9a6704b8a735b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 31 Aug 2020 04:41:34 +0000 Subject: watch: avoid unnecessary spawning on spam removals This should further mitigate lock contention problems when -watch is configured to watch on a Maildir for spam while performing a large NNTP import. There is now a small risk a message won't get removed because if it's in the current (uncommitted) fast-import batch, but unlikely given the batch size is now only 10 messages. If a that small window is hit, flipping the \Seen flag (e.g. marking it unread, and then read again) will trigger another removal attempt via IMAP or Maildir. --- lib/PublicInbox/Import.pm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/PublicInbox/Import.pm') diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index 700b4026..ee5ca2ea 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -461,6 +461,9 @@ sub init_bare { } } +# true if locked and active +sub active { !!$_[0]->{out} } + sub done { my ($self) = @_; my $w = delete $self->{out} or return; -- cgit v1.2.3-24-ge0c7