]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Config.pm
feed: support publicinbox.<name>.feedmax
[public-inbox.git] / lib / PublicInbox / Config.pm
index 5eae1f1d105ab67decf7850d70f20cbf69a0d368..6e31df7267fe0c64be3c8dc95db8e8f66819a9df 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,11 +145,15 @@ sub _fill {
        my $rv = {};
 
        foreach my $k (qw(mainrepo address filter url newsgroup
-                       infourl watch watchheader httpbackendmax)) {
+                       infourl watch watchheader httpbackendmax
+                       feedmax)) {
                my $v = $self->{"$pfx.$k"};
                $rv->{$k} = $v if defined $v;
        }
-       foreach my $k (qw(altid)) { # TODO: more arrays
+
+       # 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 ];
                }