[LON-CAPA-cvs] cvs: loncom(version_0_5_1) /lonnet/perl lonnet.pm

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 17 Sep 2002 20:01:30 -0000


matthew		Tue Sep 17 16:01:30 2002 EDT

  Modified files:              (Branch: version_0_5_1)
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  Backport of spareserver changes.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.267.4.6 loncom/lonnet/perl/lonnet.pm:1.267.4.7
--- loncom/lonnet/perl/lonnet.pm:1.267.4.6	Mon Sep 16 16:30:26 2002
+++ loncom/lonnet/perl/lonnet.pm	Tue Sep 17 16:01:30 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.267.4.6 2002/09/16 20:30:26 albertel Exp $
+# $Id: lonnet.pm,v 1.267.4.7 2002/09/17 20:01:30 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -351,9 +351,10 @@
 # ------------------------------ Find server with least workload from spare.tab
 
 sub spareserver {
+    my $loadpercent = shift;
     my $tryserver;
     my $spareserver='';
-    my $lowestserver=100;
+    my $lowestserver=$loadpercent; 
     foreach $tryserver (keys %spareid) {
        my $answer=reply('load',$tryserver);
        if (($answer =~ /\d/) && ($answer<$lowestserver)) {
@@ -3247,7 +3248,7 @@
 
     while (my $configline=<$config>) {
        chomp($configline);
-       if (($configline) && ($configline ne $perlvar{'lonHostID'})) {
+       if ($configline) {
           $spareid{$configline}=1;
        }
     }