]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
limiter: ignore unparseable rlimit
authorEric Wong <e@80x24.org>
Tue, 28 Jan 2025 08:31:11 +0000 (08:31 +0000)
committerEric Wong <e@80x24.org>
Tue, 4 Feb 2025 09:06:16 +0000 (09:06 +0000)
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

index a8d08fc3f0c86386f22c89b0beeb2e765fe166f3..b515de98af203cda29d1632ac5b60ae513f8801b 100644 (file)
@@ -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 {