]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/NNTPD.pm
miscsearch: index UIDVALIDITY, use as startup cache
[public-inbox.git] / lib / PublicInbox / NNTPD.pm
index 7f9a1d58558fb963707bd191dfa96107d6dd5dd5..6907a03cc4ed37e9ebb9582633b9c3169d35a5a7 100644 (file)
@@ -36,10 +36,12 @@ sub refresh_groups {
        my ($self, $sig) = @_;
        my $pi_cfg = $sig ? PublicInbox::Config->new : $self->{pi_cfg};
        my $groups = $pi_cfg->{-by_newsgroup}; # filled during each_inbox
+       my $cache = eval { $pi_cfg->ALL->misc->nntpd_cache_load } // {};
        $pi_cfg->each_inbox(sub {
                my ($ibx) = @_;
                my $ngname = $ibx->{newsgroup} // return;
-               if ($ibx->nntp_usable) {
+               my $ce = $cache->{$ngname};
+               if (($ce and (%$ibx = (%$ibx, %$ce))) || $ibx->nntp_usable) {
                        # only valid if msgmap and over works
                        # preload to avoid fragmentation:
                        $ibx->description;