chiark / gitweb /
routesearch: fix up web performance parameterisation
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sat, 17 Oct 2009 14:49:55 +0000 (15:49 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sat, 17 Oct 2009 14:49:55 +0000 (15:49 +0100)
yarrg/web/query_routesearch

index 587a2b6dc9df0a47c1e8f55192a8f2d96123bb43..b6d543fae1c7c122c72485a36c5bf30146f4505b 100644 (file)
@@ -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;
 
 </%perl>
 
@@ -95,8 +97,8 @@ This feature is not available from the "drop down menus" interface.
 </form>
 <%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 $!;
 }