vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r22827: LJSUP-13560: Cache user's userpic info f...

Committer: vad
LJSUP-13560: Cache user's userpic info for one request in in-process memory
U   trunk/cgi-bin/ljuserpics.pl
Modified: trunk/cgi-bin/ljuserpics.pl
===================================================================
--- trunk/cgi-bin/ljuserpics.pl	2012-09-06 13:07:10 UTC (rev 22826)
+++ trunk/cgi-bin/ljuserpics.pl	2012-09-06 14:02:28 UTC (rev 22827)
@@ -126,7 +126,7 @@
 
     if (@LJ::MEMCACHE_SERVERS) {
         my @mem_keys = map { [$_->[1],"userpic.$_->[1]"] } @load_list;
-        my $mem = LJ::MemCache::get_multi(@mem_keys) || {};
+        my $mem = LJ::MemCacheProxy::get_multi(@mem_keys) || {};
         while (my ($k, $v) = each %$mem) {
             next unless $v && $k =~ /(\d+)/;
             my $id = $1;
@@ -179,7 +179,7 @@
             $ur->{location} = uc(substr($ur->{location}, 0, 1));
 
             $LJ::CACHE_USERPIC{$id} = $ur;
-            LJ::MemCache::set([$id,"userpic.$id"], LJ::MemCache::hash_to_array("userpic", $ur));
+            LJ::MemCacheProxy::set([$id,"userpic.$id"], LJ::MemCache::hash_to_array("userpic", $ur));
         }
     }
 
@@ -210,7 +210,7 @@
         }->{delete $ur->{contenttype}};
 
         $LJ::CACHE_USERPIC{$id} = $ur;
-        LJ::MemCache::set([$id,"userpic.$id"], LJ::MemCache::hash_to_array("userpic", $ur));
+        LJ::MemCacheProxy::set([$id,"userpic.$id"], LJ::MemCache::hash_to_array("userpic", $ur));
     }
 }
 
@@ -266,7 +266,7 @@
 
     # now clear the user's memcache picture info
     LJ::Userpic->delete_cache($u);
-    LJ::MemCache::delete([$picid, "userpic.$picid"]);
+    LJ::MemCacheProxy::delete([$picid, "userpic.$picid"]);
 
     ## if this was the default userpic, "undefault" it
     if ($u->{'defaultpicid'} && $u->{'defaultpicid'}==$picid) {

Tags: livejournal, pl, vad, vadvs
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments