From 97e77af0af2db3ce89b100ad4e1cfef7055870eb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 1 Jul 2020 21:06:15 +0000 Subject: spawn: make @RLIMITS an array Making the RLIMITS list a function doesn't allow constant folding, so just make it an array accessible to other modules. --- lib/PublicInbox/Qspawn.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/Qspawn.pm') diff --git a/lib/PublicInbox/Qspawn.pm b/lib/PublicInbox/Qspawn.pm index c09e8d2c..d395a10b 100644 --- a/lib/PublicInbox/Qspawn.pm +++ b/lib/PublicInbox/Qspawn.pm @@ -48,7 +48,7 @@ sub _do_spawn { my ($cmd, $cmd_env, $opt) = @{delete $self->{args}}; my %o = %{$opt || {}}; $self->{limiter} = $limiter; - foreach my $k (PublicInbox::Spawn::RLIMITS()) { + foreach my $k (@PublicInbox::Spawn::RLIMITS) { if (defined(my $rlimit = $limiter->{$k})) { $o{$k} = $rlimit; } @@ -358,7 +358,7 @@ sub new { sub setup_rlimit { my ($self, $name, $config) = @_; - foreach my $rlim (PublicInbox::Spawn::RLIMITS()) { + foreach my $rlim (@PublicInbox::Spawn::RLIMITS) { my $k = lc($rlim); $k =~ tr/_//d; $k = "publicinboxlimiter.$name.$k"; -- cgit v1.2.3-24-ge0c7