]> Sergey Matveev's repositories - public-inbox.git/commitdiff
config: always use namespaced "publicinboxlimiter"
authorEric Wong <e@80x24.org>
Sat, 7 Jan 2017 01:44:45 +0000 (01:44 +0000)
committerEric Wong <e@80x24.org>
Sat, 7 Jan 2017 01:45:41 +0000 (01:45 +0000)
I'm not sure if we'll ever support sharing a config file
with other tools, but maybe we will, and "limiter" is
too generic.

lib/PublicInbox/Config.pm
t/config_limiter.t

index 6e31df7267fe0c64be3c8dc95db8e8f66819a9df..3e3d79ad4e888a9c9594ce320b969a049f9a2db0 100644 (file)
@@ -90,11 +90,7 @@ sub limiter {
        my ($self, $name) = @_;
        $self->{-limiters}->{$name} ||= do {
                require PublicInbox::Qspawn;
-               my $max;
-               # XXX "limiter.<name>.max" was a historical mistake
-               foreach my $pfx (qw(publicinboxlimiter limiter)) {
-                       $max ||= $self->{"$pfx.$name.max"};
-               }
+               my $max = $self->{"publicinboxlimiter.$name.max"};
                PublicInbox::Qspawn::Limiter->new($max);
        };
 }
index 3c7ec557f2bbc617b825bce2c0c93a8c1c9da43e..486bfbe9cf772972a28648e07caf04ef5ddc33c4 100644 (file)
@@ -25,7 +25,7 @@ my $cfgpfx = "publicinbox.test";
 
 {
        my $config = PublicInbox::Config->new({
-               'limiter.named.max' => 3,
+               'publicinboxlimiter.named.max' => 3,
                "$cfgpfx.address" => 'test@example.com',
                "$cfgpfx.mainrepo" => '/path/to/non/existent',
                "$cfgpfx.httpbackendmax" => 'named',