- # due to "xcpdb --reshard"
- if (-d $xpfx) {
- my $XapianDatabase;
- foreach my $shard (<$xpfx/*>) {
- -d $shard && $shard =~ m!/[0-9]+\z! or next;
- $XapianDatabase //= do {
- require PublicInbox::Search;
- PublicInbox::Search::load_xapian();
- $PublicInbox::Search::X{Database};
- };
- eval {
- $XapianDatabase->new($shard)->close;
- $n++;
- };
- }
- }
- $n;