unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] lei up: only show finmsg in top-level lei-daemon
@ 2021-08-31 19:38 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2021-08-31 19:38 UTC (permalink / raw)
  To: meta

->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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-31 19:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31 19:38 [PATCH] lei up: only show finmsg in top-level lei-daemon Eric Wong

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 NNTP newsgroup(s).