X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FInbox.pm;h=e9efd29d40a4b46f993bef2075653f632cb43544;hb=b782533a0413578de4cfd478c67a8e3d9dda0949;hp=55e546e104f538109b95f804efb53e5a556c95ad;hpb=4d8a07616ebe29771c9775173e9d01a91ec677ae;p=public-inbox.git diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index 55e546e1..e9efd29d 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -70,7 +70,7 @@ sub _cleanup_later ($) { my ($self) = @_; $cleanup_avail = cleanup_possible() if $cleanup_avail < 0; return if $cleanup_avail != 1; - $cleanup_timer ||= PublicInbox::DS::later(*cleanup_task); + $cleanup_timer //= PublicInbox::DS::later(\&cleanup_task); $CLEANUP->{"$self"} = $self; } @@ -206,14 +206,13 @@ EOF }; } -sub over ($) { - my ($self) = @_; - my $srch = search($self, 1) or return; - $self->{over} //= eval { - my $over = $srch->{over_ro}; - $over->connect; # may fail +sub over { + $_[0]->{over} //= eval { + my $srch = search($_[0], 1) or return; + my $over = PublicInbox::Over->new("$srch->{xpfx}/over.sqlite3"); + $over->dbh; # may fail $over; - } + }; } sub try_cat { @@ -423,8 +422,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 $@; } }