From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS55 158.130.0.0/16 X-Spam-Status: No, score=-2.6 required=3.0 tests=BAYES_00,RCVD_IN_MSPIKE_BL, RCVD_IN_MSPIKE_ZBI,RCVD_IN_XBL,SPF_FAIL,SPF_HELO_FAIL shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 Received: from 80x24.org (tor-exit-node.seas.upenn.edu [158.130.0.242]) by dcvr.yhbt.net (Postfix) with ESMTP id 0FBCE20A99 for ; Sat, 7 Jan 2017 01:45:02 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/9] config: always use namespaced "publicinboxlimiter" Date: Sat, 7 Jan 2017 01:44:45 +0000 Message-Id: <20170107014452.9657-3-e@80x24.org> In-Reply-To: <20170107014452.9657-1-e@80x24.org> References: <20170107014452.9657-1-e@80x24.org> List-Id: 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 | 6 +----- t/config_limiter.t | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index 6e31df7..3e3d79a 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -90,11 +90,7 @@ sub limiter { my ($self, $name) = @_; $self->{-limiters}->{$name} ||= do { require PublicInbox::Qspawn; - my $max; - # XXX "limiter..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); }; } diff --git a/t/config_limiter.t b/t/config_limiter.t index 3c7ec55..486bfbe 100644 --- a/t/config_limiter.t +++ b/t/config_limiter.t @@ -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', -- EW