madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r23104: LJSUP-13883: Journal pages optimizaiton ...

Committer: sbelyaev
LJSUP-13883: Journal pages optimizaiton : stage 1
U   trunk/cgi-bin/LJ/MemCacheProxy.pm
Modified: trunk/cgi-bin/LJ/MemCacheProxy.pm
===================================================================
--- trunk/cgi-bin/LJ/MemCacheProxy.pm	2012-10-11 10:46:05 UTC (rev 23103)
+++ trunk/cgi-bin/LJ/MemCacheProxy.pm	2012-10-11 10:46:44 UTC (rev 23104)
@@ -81,5 +81,14 @@
     return LJ::MemCache::replace($key_origin, $value, $expire);
 }
 
+sub add {
+    my ( $key_origin, $value, $expire ) = @_;
+    my $key = ref $key_origin eq 'ARRAY' ? $key_origin->[1] : $key_origin;
+
+    $singletons{$key} = $value unless $singletons{$key};
+
+    return LJ::MemCache::replace($key_origin, $value, $expire);
+}
+
 1;
 

Tags: livejournal, madeon, pm, sbelyaev
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