--- loncom/interface/lonsearchcat.pm 2002/09/16 20:57:28 1.158 +++ loncom/interface/lonsearchcat.pm 2002/10/29 19:53:45 1.159 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.158 2002/09/16 20:57:28 matthew Exp $ +# $Id: lonsearchcat.pm,v 1.159 2002/10/29 19:53:45 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1976,7 +1976,7 @@ END my $time_remaining = $max_time - (time - $starttime) ; my $last_time = $time_remaining; &update_seconds($r,$time_remaining); - while (($time_remaining > 0) && + while (($time_remaining > 0) && ((@Servers_to_contact) || keys(%Server_status))) { # Send out a search request if it needs to be done. if (@Servers_to_contact) { @@ -1994,7 +1994,13 @@ END # left to contact. sleep(1); } - &update_status($r,'waiting on '.(join(' ',keys(%Server_status)))); + # + if (scalar (keys(%Server_status))) { + &update_status($r,'waiting on '.(join(' ',keys(%Server_status)))); + } + # + # Loop through the servers we have contacted but do not + # have results from yet, looking for results. while (my ($server,$status) = each(%Server_status)) { last if ($connection->aborted()); if ($status eq 'con_lost') { @@ -2057,6 +2063,7 @@ END } last if ($connection->aborted()); # Finished looping through the servers + $starttime = time if (@Servers_to_contact); $time_remaining = $max_time - (time - $starttime) ; if ($last_time - $time_remaining > 0) { $last_time = $time_remaining;