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 3/3] lei: use PublicInbox::Eml::warn_ignore_cb
Date: Sat, 14 Dec 2024 14:58:04 +0000	[thread overview]
Message-ID: <20241214145805.755893-4-e@80x24.org> (raw)
In-Reply-To: <20241214145805.755893-1-e@80x24.org>

The open-coded callback was identical to the existing callback
generated by our Eml package, so just use the existing code
instead unless a user uses `lei import --noisy'
---
 lib/PublicInbox/LEI.pm | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 34ef95a1..1e8dc17f 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -625,12 +625,8 @@ sub _lei_atfork_child {
 	eval 'no warnings; undef $PublicInbox::LeiNoteEvent::to_flush';
 	undef $errors_log;
 	$quit = \&CORE::exit;
-	if (!$self->{opt}->{noisy}) { # only "lei import" sets this atm
-		my $cb = $SIG{__WARN__} // \&CORE::warn;
-		$SIG{__WARN__} = sub {
-			$cb->(@_) unless PublicInbox::Eml::warn_ignore(@_)
-		};
-	}
+	$self->{opt}->{noisy} or # only "lei import" sets this atm
+		$SIG{__WARN__} = PublicInbox::Eml::warn_ignore_cb();
 	$SIG{TERM} = $term_handler;
 	$current_lei = $persist ? undef : $self; # for SIG{__WARN__}
 }

      parent reply	other threads:[~2024-12-14 14:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-14 14:58 [PATCH 0/3] indexing odds and ends Eric Wong
2024-12-14 14:58 ` [PATCH 1/3] t/extindex: add --max-size test Eric Wong
2024-12-14 14:58 ` [PATCH 2/3] admin: common warn_cb Eric Wong
2024-12-14 14:58 ` Eric Wong [this message]

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=20241214145805.755893-4-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).