]> Sergey Matveev's repositories - public-inbox.git/commitdiff
extsearchidx: ignore Eml warnings across the board
authorEric Wong <e@80x24.org>
Wed, 7 Jul 2021 23:24:55 +0000 (23:24 +0000)
committerEric Wong <e@80x24.org>
Thu, 8 Jul 2021 08:32:42 +0000 (08:32 +0000)
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

index 495579a2b43bede87578228fc82481879862f55c..a421e16bb91a1899cbd4ff1b6bef2f7f86b2b3e5 100644 (file)
@@ -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) },