]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Config.pm
note the source code is AGPL for cloning
[public-inbox.git] / lib / PublicInbox / Config.pm
index d7eaa3e8f1c5100279deaefc7a0a8f1973023c5d..8d66cf8c35fcb9aba02aaed2286e5e4da580234c 100644 (file)
@@ -90,8 +90,12 @@ sub limiter {
        my ($self, $name) = @_;
        $self->{-limiters}->{$name} ||= do {
                require PublicInbox::Qspawn;
-               my $key = "limiter.$name.max";
-               PublicInbox::Qspawn::Limiter->new($self->{$key});
+               my $max;
+               # XXX "limiter.<name>.max" was a historical mistake
+               foreach my $pfx (qw(publicinboxlimiter limiter)) {
+                       $max ||= $self->{"$pfx.$name.max"};
+               }
+               PublicInbox::Qspawn::Limiter->new($max);
        };
 }
 
@@ -141,10 +145,19 @@ sub _fill {
        my $rv = {};
 
        foreach my $k (qw(mainrepo address filter url newsgroup
-                       watch watchheader httpbackendmax)) {
+                       infourl watch watchheader httpbackendmax)) {
                my $v = $self->{"$pfx.$k"};
                $rv->{$k} = $v if defined $v;
        }
+
+       # TODO: more arrays, we should support multi-value for
+       # more things to encourage decentralization
+       foreach my $k (qw(altid nntpmirror)) {
+               if (defined(my $v = $self->{"$pfx.$k"})) {
+                       $rv->{$k} = ref($v) eq 'ARRAY' ? $v : [ $v ];
+               }
+       }
+
        return unless $rv->{mainrepo};
        my $name = $pfx;
        $name =~ s/\Apublicinbox\.//;