about summary refs log tree commit homepage
path: root/lib/PublicInbox/Config.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-03-12 01:18:30 +0000
committerEric Wong <e@80x24.org>2019-04-04 09:13:58 +0000
commit7661a5732ebf4470339c1293b2ea32082af887be (patch)
tree4bf344691bae2df70ad138f88c86f749b184b17a /lib/PublicInbox/Config.pm
parent89be7a1b89a60446fc0a385c5c1cfaeec2f92c88 (diff)
downloadpublic-inbox-7661a5732ebf4470339c1293b2ea32082af887be.tar.gz
I mainly need this to enforce RLIMIT_CPU (and RLIMIT_CORE)
when requests come which generate giant, unrealistic diffs.

Per-coderepo limiters may be added in the future.  But for now,
I need to prevent cgit from monopolizing resources on my dinky
server.
Diffstat (limited to 'lib/PublicInbox/Config.pm')
-rw-r--r--lib/PublicInbox/Config.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm
index 6f62712f..9c1c3e2c 100644
--- a/lib/PublicInbox/Config.pm
+++ b/lib/PublicInbox/Config.pm
@@ -132,7 +132,7 @@ sub limiter {
         my ($self, $name) = @_;
         $self->{-limiters}->{$name} ||= do {
                 require PublicInbox::Qspawn;
-                my $max = $self->{"publicinboxlimiter.$name.max"};
+                my $max = $self->{"publicinboxlimiter.$name.max"} || 1;
                 my $limiter = PublicInbox::Qspawn::Limiter->new($max);
                 $limiter->setup_rlimit($name, $self);
                 $limiter;