->each_inbox will never attempt to iterate an object
without {inboxdir}, and simplify + short-circuit the
corresponding code
}
}
- # backwards compatibility:
- $ibx->{inboxdir} //= $self->{"$pfx.mainrepo"};
- if (($ibx->{inboxdir} // '') =~ /\n/s) {
+ # "mainrepo" is backwards compatibility:
+ $ibx->{inboxdir} //= $self->{"$pfx.mainrepo"} // return;
+ if ($ibx->{inboxdir} =~ /\n/s) {
warn "E: `$ibx->{inboxdir}' must not contain `\\n'\n";
return;
}
}
}
- return unless defined($ibx->{inboxdir});
my $name = $pfx;
$name =~ s/\Apublicinbox\.//;
package PublicInbox::InboxIdle;
use strict;
use parent qw(PublicInbox::DS);
-use Cwd qw(abs_path);
use PublicInbox::Syscall qw(EPOLLIN EPOLLET);
my $IN_MODIFY = 0x02; # match Linux inotify
my $ino_cls;
sub in2_arm ($$) { # PublicInbox::Config::each_inbox callback
my ($ibx, $self) = @_;
- my $dir = abs_path($ibx->{inboxdir});
- if (!defined($dir)) {
- warn "W: $ibx->{inboxdir} not watched: $!\n";
- return;
- }
+ my $dir = $ibx->{inboxdir};
my $inot = $self->{inot};
my $cur = $self->{pathmap}->{$dir} //= [];