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-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,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 E8CC71F8C6 for ; Tue, 31 Aug 2021 19:38:03 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] lei up: only show finmsg in top-level lei-daemon Date: Tue, 31 Aug 2021 19:38:03 +0000 Message-Id: <20210831193803.15510-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: ->DESTROY can get triggered in child processes, which unnecessarily duplicates messages queued up for display when lei spawns extra workers. --- lib/PublicInbox/LeiFinmsg.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/LeiFinmsg.pm b/lib/PublicInbox/LeiFinmsg.pm index 0ef5f070..395e7d3c 100644 --- a/lib/PublicInbox/LeiFinmsg.pm +++ b/lib/PublicInbox/LeiFinmsg.pm @@ -9,13 +9,13 @@ use v5.10.1; sub new { my ($cls, $io) = @_; - bless [ $io ], $cls; + bless [ $io, $$ ], $cls; } sub DESTROY { my ($self) = @_; my $io = shift @$self; - print $io @$self; + shift(@$self) == $$ and print $io @$self; } 1;