]> Sergey Matveev's repositories - public-inbox.git/commitdiff
inbox: name variable for values loop iterator
authorEric Wong <e@80x24.org>
Sat, 26 Dec 2020 08:12:52 +0000 (08:12 +0000)
committerEric Wong <e@80x24.org>
Sat, 26 Dec 2020 19:27:15 +0000 (19:27 +0000)
->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

index ec8469e3e1cfd2a95a9fe4ef3e801181f314b81f..1b9b56ff1a7220e12350b726520bfcf91efa59e2 100644 (file)
@@ -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 $@;
        }
 }