[LON-CAPA-cvs] cvs: loncom(version_1_3_X_memcached) /lonnet/perl lonnet.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Mon, 14 Feb 2005 03:12:07 -0000
albertel Sun Feb 13 22:12:07 2005 EDT
Modified files: (Branch: version_1_3_X_memcached)
/loncom/lonnet/perl lonnet.pm
Log:
- convert courseresdatacache to memcache
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.587.2.3.2.7 loncom/lonnet/perl/lonnet.pm:1.587.2.3.2.8
--- loncom/lonnet/perl/lonnet.pm:1.587.2.3.2.7 Sun Feb 13 22:11:07 2005
+++ loncom/lonnet/perl/lonnet.pm Sun Feb 13 22:12:06 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.587.2.3.2.7 2005/02/14 03:11:07 albertel Exp $
+# $Id: lonnet.pm,v 1.587.2.3.2.8 2005/02/14 03:12:06 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -38,7 +38,7 @@
qw(%perlvar %hostname %homecache %badServerCache %hostip %iphost %spareid %hostdom
%libserv %pr %prp $memcache %packagetab
%courselogs %accesshash %userrolehash $processmarker $dumpcount
- %coursedombuf %coursenumbuf %coursehombuf %coursedescrbuf %courseinstcodebuf %courseownerbuf %courseresdatacache
+ %coursedombuf %coursenumbuf %coursehombuf %coursedescrbuf %courseinstcodebuf %courseownerbuf
%userresdatacache %getsectioncache %domaindescription %domain_auth_def %domain_auth_arg_def
%domain_lang_def %domain_city %domain_longi %domain_lati $tmpdir $_64bit);
@@ -4199,7 +4199,7 @@
sub devalidatecourseresdata {
my ($coursenum,$coursedomain)=@_;
my $hashid=$coursenum.':'.$coursedomain;
- &devalidate_cache(\%courseresdatacache,$hashid,'courseres');
+ &devalidate_cache_new('courseres',$hashid);
}
# --------------------------------------------------- Course Resourcedata Query
@@ -4208,18 +4208,18 @@
my ($coursenum,$coursedomain,@which)=@_;
my $coursehom=&homeserver($coursenum,$coursedomain);
my $hashid=$coursenum.':'.$coursedomain;
- my ($result,$cached)=&is_cached(\%courseresdatacache,$hashid,'courseres');
+ my ($result,$cached)=&is_cached_new('courseres',$hashid);
unless (defined($cached)) {
my %dumpreply=&dump('resourcedata',$coursedomain,$coursenum);
$result=\%dumpreply;
my ($tmp) = keys(%dumpreply);
if ($tmp !~ /^(con_lost|error|no_such_host)/i) {
- &do_cache(\%courseresdatacache,$hashid,$result,'courseres');
+ &do_cache_new('courseres',$hashid,$result,600);
} elsif ($tmp =~ /^(con_lost|no_such_host)/) {
return $tmp;
} elsif ($tmp =~ /^(error)/) {
$result=undef;
- &do_cache(\%courseresdatacache,$hashid,$result,'courseres');
+ &do_cache_new('courseres',$hashid,$result,600);
}
}
foreach my $item (@which) {
@@ -5656,7 +5656,7 @@
# &logthis(sprintf("%-20s is %s",'%metacache',scalar(%metacache)));
&logthis(sprintf("%-20s is %s",'%homecache',length(&freeze(\%homecache))));
# &logthis(sprintf("%-20s is %s",'%titlecache',length(&freeze(\%titlecache))));
- &logthis(sprintf("%-20s is %s",'%courseresdatacache',length(&freeze(\%courseresdatacache))));
+# &logthis(sprintf("%-20s is %s",'%courseresdatacache',length(&freeze(\%courseresdatacache))));
#1.1 only
&logthis(sprintf("%-20s is %s",'%userresdatacache',length(&freeze(\%userresdatacache))));
&logthis(sprintf("%-20s is %s",'%getsectioncache',length(&freeze(\%getsectioncache))));