--- loncom/interface/lonindexer.pm 2004/07/07 00:02:00 1.119 +++ loncom/interface/lonindexer.pm 2004/07/26 22:38:16 1.121 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.119 2004/07/07 00:02:00 taceyjo1 Exp $ +# $Id: lonindexer.pm,v 1.121 2004/07/26 22:38:16 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -519,7 +519,7 @@ END $r->print("".&mt("Language")."\n") if ($hash{'display_attrs_6'} == 1); $r->print("".&mt("Usage Statistics")."
(". - &mt("Courses/Network Hits").")
\n") + &mt("Courses/Network Hits").") ".&mt('updated periodically')."\n") if ($hash{'display_attrs_8'} == 1); $r->print("".&mt("Source Available")."\n") if ($hash{'display_attrs_10'} == 1); @@ -662,10 +662,13 @@ sub get_list { if ($ENV{'form.updatedisplay'}) { foreach (keys %hash) { delete $hash{$_} if ($_ =~ /^dirlist_files_/); + delete $hash{$_} if ($_ =~ /^dirlist_timestamp_files_/); } } - if ($hash{'dirlist_files_'.$luri}) { + if (defined($hash{'dirlist_files_'.$luri}) && + $hash{'dirlist_timestamp_files_'.$luri}+600 > (time)) { + &Apache::lonnet::logthis("using old n:".time." s:".$hash{'dirlist_timestamp_files_'.$luri}); @list = split(/\n/,$hash{'dirlist_files_'.$luri}); } elsif ($uri=~/\.(page|sequence)\/$/) { # is a page or a sequence @@ -679,8 +682,10 @@ sub get_list { $hash{'dirlist_files_'.$luri} = join("\n",@list); } else { # is really a directory + &Apache::lonnet::logthis("getting fresh n:".time." s:".$hash{'dirlist_timestamp_files_'.$luri}); @list = &Apache::lonnet::dirlist($uri); $hash{'dirlist_files_'.$luri} = join("\n",@list); + $hash{'dirlist_timestamp_files_'.$luri} = time; } return @list=&match_ext($r,@list); }