]> 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 20:20:13 +0000 (20:20 +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.

(cherry picked from commit b5e960f50289434025f5904c8c1311e4c8a02b82)

lib/PublicInbox/Inbox.pm

index b0894a7d6414d038d820afa4533a2c2f69321ddd..e9efd29d40a4b46f993bef2075653f632cb43544 100644 (file)
@@ -422,8 +422,8 @@ sub on_unlock {
        my ($self) = @_;
        check_inodes($self);
        my $subs = $self->{unlock_subs} or return;
        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 $@;
        }
 }
                warn "E: $@ ($self->{inboxdir})\n" if $@;
        }
 }