unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] extsearchidx: ignore Eml warnings across the board
Date: Wed,  7 Jul 2021 23:24:55 +0000	[thread overview]
Message-ID: <20210707232455.27204-1-e@80x24.org> (raw)

There's nothing we can do about misformatted emails and headers
we get from untrusted sources.  They're too noisy and those
messages already exist in public-inboxes, anyways, so just
keep things quiet so we can spot real problems more easily.
---
 lib/PublicInbox/ExtSearchIdx.pm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm
index 495579a2..a421e16b 100644
--- a/lib/PublicInbox/ExtSearchIdx.pm
+++ b/lib/PublicInbox/ExtSearchIdx.pm
@@ -891,10 +891,6 @@ SELECT DISTINCT(mid),id FROM msgid WHERE id IN
 ORDER BY id
 EOS
 	$iter->execute($min_id);
-	local $SIG{__WARN__} = sub {
-		return if PublicInbox::Eml::warn_ignore(@_);
-		warn @_;
-	};
 	while (my ($mid, $id) = $iter->fetchrow_array) {
 		last if $sync->{quit};
 		$self->{current_info} = "dedupe $mid";
@@ -942,6 +938,7 @@ sub eidx_sync { # main entry point
 	my $warn_cb = $SIG{__WARN__} || \&CORE::warn;
 	local $self->{current_info} = '';
 	local $SIG{__WARN__} = sub {
+		return if PublicInbox::Eml::warn_ignore(@_);
 		$warn_cb->($self->{current_info}, ': ', @_);
 	};
 	$self->idx_init($opt); # acquire lock via V2Writable::_idx_init
@@ -1238,7 +1235,10 @@ sub eidx_watch { # public-inbox-extindex --watch main loop
 	my $oldset = PublicInbox::DS::block_signals();
 	local $self->{current_info} = '';
 	my $cb = $SIG{__WARN__} || \&CORE::warn;
-	local $SIG{__WARN__} = sub { $cb->($self->{current_info}, ': ', @_) };
+	local $SIG{__WARN__} = sub {
+		return if PublicInbox::Eml::warn_ignore(@_);
+		$cb->($self->{current_info}, ': ', @_);
+	};
 	my $sig = {
 		HUP => sub { eidx_reload($self, $idler) },
 		USR1 => sub { eidx_resync_start($self) },

                 reply	other threads:[~2021-07-07 23:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210707232455.27204-1-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).