From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id E829E200A8 for ; Tue, 27 Oct 2020 07:55:01 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 50/52] extsearchidx: set current_info in warning callbacks Date: Tue, 27 Oct 2020 07:54:51 +0000 Message-Id: <20201027075453.19163-51-e@80x24.org> In-Reply-To: <20201027075453.19163-1-e@80x24.org> References: <20201027075453.19163-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This bit is duplicated with per-Inbox indexing in Admin, undecided if it's the right place for it. --- lib/PublicInbox/ExtSearchIdx.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm index bfe39891..050c4252 100644 --- a/lib/PublicInbox/ExtSearchIdx.pm +++ b/lib/PublicInbox/ExtSearchIdx.pm @@ -296,6 +296,11 @@ sub eidx_sync { # main entry point $self->idx_init($opt); # acquire lock via V2Writable::_idx_init $self->{oidx}->rethread_prepare($opt); + my $warn_cb = $SIG{__WARN__} || sub { print STDERR @_ }; + local $self->{current_info} = ''; + local $SIG{__WARN__} = sub { + $warn_cb->($self->{current_info}, ': ', @_); + }; _sync_inbox($self, $opt, $_) for (@{$self->{ibx_list}}); $self->{oidx}->rethread_done($opt);