[LON-CAPA-cvs] cvs: loncom /interface lonspreadsheet.pm

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 30 Sep 2002 18:47:44 -0000


matthew		Mon Sep 30 14:47:44 2002 EDT

  Modified files:              
    /loncom/interface	lonspreadsheet.pm 
  Log:
  No longer need to ask for 'resourcedata.db' file every assessment sheet. 
  Now cache the fact that it did not exist.  This reduces the number of
  calls to lonnet::dump to 1 instead of 1 per assessment.
  
  
Index: loncom/interface/lonspreadsheet.pm
diff -u loncom/interface/lonspreadsheet.pm:1.113 loncom/interface/lonspreadsheet.pm:1.114
--- loncom/interface/lonspreadsheet.pm:1.113	Mon Sep 30 14:03:39 2002
+++ loncom/interface/lonspreadsheet.pm	Mon Sep 30 14:47:43 2002
@@ -1,5 +1,5 @@
 #
-# $Id: lonspreadsheet.pm,v 1.113 2002/09/30 18:03:39 matthew Exp $
+# $Id: lonspreadsheet.pm,v 1.114 2002/09/30 18:47:43 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2096,8 +2096,11 @@
                 &Apache::lonnet::reply('dump:'.$udom.':'.$uname.':resourcedata',$uhome);
             if ($reply!~/^error\:/) {
                 $userrdatas{$uname.'___'.$udom}=$reply;
-                $userrdatas{$uname.'___'.$udom.'.last_cache'}=time;
             }
+            # Most of the time the user does not have a 'resourcedata.db' 
+            # file.  We need to cache that we got nothing instead of bothering
+            # with requesting it every time.
+            $userrdatas{$uname.'___'.$udom.'.last_cache'}=time;
         }
         foreach (split(/\&/,$userrdatas{$uname.'___'.$udom})) {
             my ($name,$value)=split(/\=/,$_);