From: Eric Wong Date: Tue, 31 Aug 2021 19:38:03 +0000 (+0000) Subject: lei up: only show finmsg in top-level lei-daemon X-Git-Tag: v1.7.0~464 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=66ac16e2afe11100f1e359d04da399589af05d31;p=public-inbox.git lei up: only show finmsg in top-level lei-daemon ->DESTROY can get triggered in child processes, which unnecessarily duplicates messages queued up for display when lei spawns extra workers. --- 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;