From 757318e3924059c13338aada3b29d668c20f6c36 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 17 Oct 2009 15:49:55 +0100 Subject: [PATCH] routesearch: fix up web performance parameterisation --- yarrg/web/query_routesearch | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/yarrg/web/query_routesearch b/yarrg/web/query_routesearch index 587a2b6..b6d543f 100644 --- a/yarrg/web/query_routesearch +++ b/yarrg/web/query_routesearch @@ -52,11 +52,13 @@ my $emsg; my @warningfs; my @islandids; +my $maxmaxdist=35; +my $maxcpu=90; + my $qa= \%ARGS; my $routeparams= { EmsgRef => \$emsg, SayRequiredCapacity => 1 }; my $maxdist; my $maxcountea=10; -my $maxcpu=10; @@ -95,8 +97,8 @@ This feature is not available from the "drop down menus" interface. <%perl> -if (!$emsg && $maxdist > 30) { - $emsg= "Searching for routes of more than 30 leagues is not". +if (!$emsg && $maxdist > $maxmaxdist) { + $emsg= "Searching for routes of more than $maxmaxdist leagues is not". " supported, sorry."; } @@ -152,7 +154,7 @@ my $child= $fh->open("-|"); defined $child or die $!; if (!$child) { my $cpu= BSD::Resource::RLIMIT_CPU; my ($soft,$hard)= getrlimit($cpu); - setrlimit($cpu,$maxcpu,$hard) or die $! if $soft>$maxcpu; + setrlimit($cpu,$maxcpu,$hard) or die $! if $hard<=$maxcpu; exec @rsargs; die $!; } -- 2.30.2