user/dev discussion of public-inbox itself
 help / Atom feed
* [PATCH] config: use "publicinboxlimiter" prefix
@ 2016-09-02 21:02 Eric Wong
  0 siblings, 0 replies; 1+ messages in thread
From: Eric Wong @ 2016-09-02 21:02 UTC (permalink / raw)
  To: meta

Just having "limiter" in the prefix may confuse
it with something else.  Use the full prefix to
avoid this confusion.
---
 lib/PublicInbox/Config.pm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm
index 5adcd0c..8d66cf8 100644
--- a/lib/PublicInbox/Config.pm
+++ b/lib/PublicInbox/Config.pm
@@ -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);
 	};
 }
 
-- 
EW


^ permalink raw reply	[flat|threaded] 1+ messages in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-02 21:02 [PATCH] config: use "publicinboxlimiter" prefix Eric Wong

user/dev discussion of public-inbox itself

Archives are clonable:
	git clone --mirror https://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://ou63pmih66umazou.onion/inbox.comp.mail.public-inbox.meta
	nntp://czquwvybam4bgbro.onion/inbox.comp.mail.public-inbox.meta
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.org/gmane.mail.public-inbox.general

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox