--- loncom/lonnet/perl/lonnet.pm 2002/12/05 23:27:46 1.308 +++ loncom/lonnet/perl/lonnet.pm 2002/12/06 16:34:55 1.311 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.308 2002/12/05 23:27:46 albertel Exp $ +# $Id: lonnet.pm,v 1.311 2002/12/06 16:34:55 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -81,7 +81,7 @@ qw(%perlvar %hostname %homecache %badSer %libserv %pr %prp %metacache %packagetab %titlecache %courselogs %accesshash $processmarker $dumpcount %coursedombuf %coursehombuf %courseresdatacache - %studentresdatacache %domaindescription); + %domaindescription); use IO::Socket; use GDBM_File; use Apache::Constants qw(:common :http); @@ -143,9 +143,9 @@ sub reply { unless (defined($hostname{$server})) { return 'no_such_host'; } my $answer=subreply($cmd,$server); if ($answer eq 'con_lost') { - #sleep 5; - #$answer=subreply($cmd,$server); - #if ($answer eq 'con_lost') { + #sleep 5; + #$answer=subreply($cmd,$server); + #if ($answer eq 'con_lost') { # &logthis("Second attempt con_lost on $server"); # my $peerfile="$perlvar{'lonSockDir'}/$server"; # my $client=IO::Socket::UNIX->new(Peer =>"$peerfile", @@ -203,7 +203,6 @@ sub critical { " Critical message to unknown server ($server)"); return 'no_such_host'; } - sleep 2; my $answer=reply($cmd,$server); if ($answer eq 'con_lost') { my $pingreply=reply('ping',$server); @@ -2851,8 +2850,9 @@ sub EXT { # ----------------------------------------------------------- first, check user #most student don't have any data set, check if there is some data #every thirty minutes - if (!exists($studentresdatacache{$uname.'_'.$udom}) - || $studentresdatacache{$uname.'_'.$udom} > (time+1800)) { + if (! + (exists($ENV{'cache.studentresdata'}) + && (($ENV{'cache.studentresdata'}+1800) > time))) { my %resourcedata=&get('resourcedata', [$courselevelr,$courselevelm,$courselevel], $udom,$uname); @@ -2871,7 +2871,9 @@ sub EXT { $uname." at ".$udom.": ". $tmp.""); } elsif ($tmp=~/error:No such file/) { - $studentresdatacache{$uname.'_'.$udom}=time; + $ENV{'cache.studentresdata'}=time; + &appenv(('cache.studentresdata'=> + $ENV{'cache.studentresdata'})); } elsif ($tmp =~ /^(con_lost|no_such_host)/) { return $tmp; }