unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 1/3] limiter: ignore unparseable rlimit
Date: Tue, 28 Jan 2025 08:31:11 +0000	[thread overview]
Message-ID: <20250128083113.1773883-2-e@80x24.org> (raw)
In-Reply-To: <20250128083113.1773883-1-e@80x24.org>

Instead of blindly accepting whatever bogus values the config
gave us, ignore it and use the `W:' prefix to be consistent
with the rest of our codebase.
---
 lib/PublicInbox/Limiter.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/Limiter.pm b/lib/PublicInbox/Limiter.pm
index a8d08fc3..b515de98 100644
--- a/lib/PublicInbox/Limiter.pm
+++ b/lib/PublicInbox/Limiter.pm
@@ -29,7 +29,8 @@ sub setup_rlimit {
 		if (scalar(@rlimit) == 1) {
 			push @rlimit, $rlimit[0];
 		} elsif (scalar(@rlimit) != 2) {
-			warn "could not parse $k: $v\n";
+			warn "W: could not parse $k: $v (ignored)\n";
+			next;
 		}
 		my $inf = $v =~ /\binfinity\b/i ?
 			$PublicInbox::Spawn::RLIMITS{RLIM_INFINITY} // eval {

  reply	other threads:[~2025-01-28  8:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-28  8:31 [PATCH 0/3] limiter updates Eric Wong
2025-01-28  8:31 ` Eric Wong [this message]
2025-01-28  8:31 ` [PATCH 2/3] www: configurable "-httpbackend" named limiter Eric Wong
2025-01-28  8:31 ` [PATCH 3/3] git_http_backend: use default limiter from Qspawn Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250128083113.1773883-2-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).