]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Config.pm
config: allow per-inbox nntpserver
[public-inbox.git] / lib / PublicInbox / Config.pm
index 1256fb1e7df208ca9bb17fb269ad639d99c789c6..28b5bdb5f895547909694f4c4916b9d7297f439e 100644 (file)
@@ -90,17 +90,11 @@ 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 = $self->{"publicinboxlimiter.$name.max"};
+               PublicInbox::Qspawn::Limiter->new($max);
        };
 }
 
-sub get {
-       my ($self, $inbox, $key) = @_;
-
-       $self->{"publicinbox.$inbox.$key"};
-}
-
 sub config_dir { $ENV{PI_DIR} || "$ENV{HOME}/.public-inbox" }
 
 sub default_file {
@@ -141,10 +135,20 @@ sub _fill {
        my $rv = {};
 
        foreach my $k (qw(mainrepo address filter url newsgroup
-                       infourl watch watchheader httpbackendmax)) {
+                       infourl watch watchheader httpbackendmax
+                       feedmax nntpserver)) {
                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\.//;