X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;ds=sidebyside;f=yarrg%2Fweb%2Fquery_routesearch;h=6f051351ca2f981bf677f2bd2fa4394f78a81459;hb=8fb8cf52d2bf96beda40c30134e04a352ff988b4;hp=34fbc22e38d25584a078afd1caf05b78ed1b7497;hpb=3579e35d2b8ed951db24cc4873c155fded7f4375;p=ypp-sc-tools.main.git
diff --git a/yarrg/web/query_routesearch b/yarrg/web/query_routesearch
index 34fbc22..6f05135 100644
--- a/yarrg/web/query_routesearch
+++ b/yarrg/web/query_routesearch
@@ -56,6 +56,7 @@ my $qa= \%ARGS;
my $routeparams= { EmsgRef => \$emsg, SayRequiredCapacity => 1 };
my $maxdist;
my $maxcountea=10;
+my $maxcpu=10;
%perl>
@@ -122,7 +123,7 @@ my $isleinfo = sub {
#---------- compute the results ----------
-my @rsargs;
+my @rsargs= qw(-DN);
foreach my $k (qw(MaxMass MaxVolume MaxCapital)) {
my $v= $routeparams->{$k};
@@ -130,20 +131,18 @@ foreach my $k (qw(MaxMass MaxVolume MaxCapital)) {
}
push @rsargs, defined $routeparams->{LossPerLeaguePct}
? $routeparams->{LossPerLeaguePct}*0.01 : 1e-9;
-push @rsargs, 'search', $maxcountea,$maxcountea, $maxdist, 'any', @islandids;
+push @rsargs, 'search',$maxdist, $maxcountea,$maxcountea, 'any', @islandids;
m/[^-.0-9a-zA-Z]/ and die "$_ $& ?" foreach @rsargs;
-unshift @rsargs, dbw_filename($qa->{'Ocean'});
-unshift @rsargs, qw(-DN);
-
if ($qa->{'debug'}) {
%perl>
[[ <% "@rsargs" |h %> ]]
<%perl> } -unshift @rsargs, sourcebasedir().'/yarrg/routesearch'; +unshift @rsargs, sourcebasedir().'/yarrg/routesearch', + '-d', dbw_filename($qa->{'Ocean'}); my %results; # $results{$ap}{"5 6 9 10"} = { stuff } @@ -152,8 +151,7 @@ my $child= $fh->open("-|"); defined $child or die $!; if (!$child) { my $cpu= BSD::Resource::RLIMIT_CPU; my ($soft,$hard)= getrlimit($cpu); - my $max=10; - setrlimit($cpu,$max,$hard) or die $! if $soft>$max; + setrlimit($cpu,$maxcpu,$hard) or die $! if $soft>$maxcpu; exec @rsargs; die $!; } @@ -222,7 +220,7 @@ if ($qa->{'debug'}) {<% $item->{A} |h %> <% $item->{P} |h %> <% join ', ', @{ $item->{Archs} } |h %> - <% $item->{Start} |h %>, + <% $item->{Start} |h %>, <% join ' ', map { $_.',' } @{ $item->{Vias} } |h %> <% $item->{Finish} |h %>