Subject: [LON-CAPA-dev] Re: [LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

From: "Matthew Brian Hall" <[email-masked]>
Date: Fri, 6 Dec 2002 09:14:05 -0500 (EST)

30 minutes?  Instructors already complain about 5 minutes...

>
> albertel        Thu Dec  5 18:27:46 2002 EDT
>
>   Modified files:
>     /loncom/lonnet/perl    lonnet.pm
>   Log:
>   - if the student doen't even have a resourcedata.db remeber this and don't k
eep trying to get one, this is a big speed win
>
>
> Index: loncom/lonnet/perl/lonnet.pm
> diff -u loncom/lonnet/perl/lonnet.pm:1.307 loncom/lonnet/perl/lonnet.pm:1.308
> --- loncom/lonnet/perl/lonnet.pm:1.307    Thu Dec  5 18:13:54 2002
> +++ loncom/lonnet/perl/lonnet.pm    Thu Dec  5 18:27:46 2002
> @@ -1,7 +1,7 @@
>  # The LearningOnline Network
>  # TCP networking package
>  #
> -# $Id: lonnet.pm,v 1.307 2002/12/05 23:13:54 albertel Exp $
> +# $Id: lonnet.pm,v 1.308 2002/12/05 23:27:46 albertel Exp $
>  #
>  # Copyright Michigan State University Board of Trustees
>  #
> @@ -80,7 +80,8 @@
>  qw(%perlvar %hostname %homecache %badServerCache %hostip %iphost %spareid %ho
stdom
>     %libserv %pr %prp %metacache %packagetab %titlecache
>     %courselogs %accesshash $processmarker $dumpcount
> -   %coursedombuf %coursehombuf %courseresdatacache %domaindescription);
> +   %coursedombuf %coursehombuf %courseresdatacache
> +   %studentresdatacache %domaindescription);
>  use IO::Socket;
>  use GDBM_File;
>  use Apache::Constants qw(:common :http);
> @@ -2848,25 +2849,32 @@
>          my $courselevelm=$courseid.'.'.$mapparm;
>
>  # ----------------------------------------------------------- first, check us
er
> -        my %resourcedata=&get('resourcedata',
> -                  [$courselevelr,$courselevelm,$courselevel],
> -                 $udom,$uname);
> -        my ($tmp)=keys(%resourcedata);
> -        if (($tmp!~/^error\:/) && ($tmp!~/^con_lost/)) {
> -        if ($resourcedata{$courselevelr}) {
> -            return $resourcedata{$courselevelr}; }
> -        if ($resourcedata{$courselevelm}) {
> -            return $resourcedata{$courselevelm}; }
> -        if ($resourcedata{$courselevel}) {
> -            return $resourcedata{$courselevel}; }
> -        } else {
> -        if ($tmp!~/No such file/) {
> -            &logthis("<font color=blue>WARNING:".
> -                 " Trying to get resource data for ".
> -                 $uname." at ".$udom.": ".
> -                 $tmp."</font>");
> -        } elsif ($tmp =~ /^(con_lost|no_such_host)/) {
> -          return $tmp;
> +        #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)) {
> +        my %resourcedata=&get('resourcedata',
> +                      [$courselevelr,$courselevelm,$courselevel],
> +                      $udom,$uname);
> +        my ($tmp)=keys(%resourcedata);
> +        if (($tmp!~/^error\:/) && ($tmp!~/^con_lost/)) {
> +            if ($resourcedata{$courselevelr}) {
> +            return $resourcedata{$courselevelr}; }
> +            if ($resourcedata{$courselevelm}) {
> +            return $resourcedata{$courselevelm}; }
> +            if ($resourcedata{$courselevel}) {
> +            return $resourcedata{$courselevel}; }
> +        } else {
> +            if ($tmp!~/No such file/) {
> +            &logthis("<font color=blue>WARNING:".
> +                 " Trying to get resource data for ".
> +                 $uname." at ".$udom.": ".
> +                 $tmp."</font>");
> +            } elsif ($tmp=~/error:No such file/) {
> +            $studentresdatacache{$uname.'_'.$udom}=time;
> +            } elsif ($tmp =~ /^(con_lost|no_such_host)/) {
> +            return $tmp;
> +            }
>          }
>          }
>
>
>
> _______________________________________________
> LON-CAPA-cvs mailing list
> [email-masked]
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-cvs
>

--
------------------------------------------------------------------
Matthew Hall           LON-CAPA developer         [email-masked]
123 North Kedzie Hall                    Michigan State University
------------------------------------------------------------------

---

From: Gerd Kortemeyer <[email-masked]>
Date: Fri, 06 Dec 2002 09:43:03 -0500

Thirty minutes is indeed far too much buffer time!!! Instructors often change
deadlines, etc, to satisfy courses if something goes kaputt. This needs to stay in
the 5 minute realm.

Matthew Brian Hall wrote:

> LON-CAPA-dev mailing list
> [email-masked]
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-dev

---

From: Guy Albertelli II <[email-masked]>
Date: Fri, 6 Dec 2002 14:57:47 -0500 (EST)

> deadlines, etc, to satisfy courses if something goes kaputt. This needs to stay in

Actually it will check for changes.

This affects only the case where

1) the student hasn't any student specific parameters in any course
2) the instructor adds a parameter
3) the student doesn't log out and log back in during those 30
minutes.

So in some sense it is faster because it will cause it to take affect
as soon as a student logs out and logs back in.

But if you want to chop it down go right ahead.
-- 
[email-masked]          BM: n^20 t20 z20 qS 
Guy Albertelli -7-7-7-  O-
    I have the choice: to live my life in wellness. . .  or get sick
    and wallow in all that attention.