]> Sergey Matveev's repositories - public-inbox.git/commitdiff
admin: warn and ignore inaccessible inboxes
authorEric Wong <e@80x24.org>
Sat, 14 Sep 2019 09:21:05 +0000 (09:21 +0000)
committerEric Wong <e@80x24.org>
Sat, 14 Sep 2019 09:22:11 +0000 (09:22 +0000)
For whatever reason, inbox directories can go missing
temporarily or permanently.  Tell the admin about them
and continue on our way.

lib/PublicInbox/Admin.pm

index 6e710cd59794f485faefd9973b3f1f0818da3489..dc70d690b8f4cd25b5bb5f3f0d056102594df961 100644 (file)
@@ -101,7 +101,14 @@ sub resolve_inboxes ($;$) {
                $cfg->each_inbox(sub {
                        my ($ibx) = @_;
                        $ibx->{version} ||= 1;
-                       $dir2ibx{abs_path($ibx->{mainrepo})} = $ibx;
+                       my $path = abs_path($ibx->{mainrepo});
+                       if (defined($path)) {
+                               $dir2ibx{$path} = $ibx;
+                       } else {
+                               warn <<EOF;
+W: $ibx->{name} $ibx->{mainrepo}: $!
+EOF
+                       }
                });
        }
        if ($opt->{all}) {