unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] inbox: name variable for values loop iterator
@ 2020-12-26  8:12 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2020-12-26  8:12 UTC (permalink / raw)
  To: meta

->on_inbox_unlock callbacks could clobber $_, and this seems to
fix a problem with -extindex --watch failing to index some
inboxes after SIGHUP reload.
---
 lib/PublicInbox/Inbox.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index ec8469e3..1b9b56ff 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -414,8 +414,8 @@ sub on_unlock {
 	my ($self) = @_;
 	check_inodes($self);
 	my $subs = $self->{unlock_subs} or return;
-	for (values %$subs) {
-		eval { $_->on_inbox_unlock($self) };
+	for my $obj (values %$subs) {
+		eval { $obj->on_inbox_unlock($self) };
 		warn "E: $@ ($self->{inboxdir})\n" if $@;
 	}
 }

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

only message in thread, other threads:[~2020-12-26  8:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-26  8:12 [PATCH] inbox: name variable for values loop iterator 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 read-only IMAP folder(s) and NNTP newsgroup(s).