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

damieng damieng at source.lon-capa.org
Thu Sep 15 12:30:10 EDT 2016


damieng		Thu Sep 15 16:30:10 2016 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  made rendering a directory with many problems a lot faster by reducing the number of lonnet requests
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.523 loncom/interface/lonnavmaps.pm:1.524
--- loncom/interface/lonnavmaps.pm:1.523	Thu Sep  1 19:31:05 2016
+++ loncom/interface/lonnavmaps.pm	Thu Sep 15 16:30:10 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.523 2016/09/01 19:31:05 damieng Exp $
+# $Id: lonnavmaps.pm,v 1.524 2016/09/15 16:30:10 damieng Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4787,8 +4787,14 @@
     my $self = shift;
     
     if (!defined($self->{RETURN_HASH})) {
-        my %tmpHash  = &Apache::lonnet::restore($self->{SYMB},undef,$self->{DOMAIN},$self->{USERNAME});
-        $self->{RETURN_HASH} = \%tmpHash;
+        #my %tmpHash  = &Apache::lonnet::restore($self->{SYMB},undef,$self->{DOMAIN},$self->{USERNAME});
+        #$self->{RETURN_HASH} = \%tmpHash;
+        # When info is retrieved for several resources (as when rendering a directory),
+        # it is much faster to use the user profile dump and avoid repeated lonnet requests
+        # (especially since lonnet::currentdump is using Lond directly whenever possible,
+        # and lonnet::restore is not at this point).
+        $self->{NAV_MAP}->get_user_data();
+        $self->{RETURN_HASH} = $self->{NAV_MAP}->{STUDENT_DATA}->{$self->{SYMB}};
     }
 }       
 




More information about the LON-CAPA-cvs mailing list