vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r17490: Site optimization

Committer: vsukhanov
Site optimization
U   trunk/cgi-bin/ljuserpics.pl
Modified: trunk/cgi-bin/ljuserpics.pl
===================================================================
--- trunk/cgi-bin/ljuserpics.pl	2010-10-04 04:24:12 UTC (rev 17489)
+++ trunk/cgi-bin/ljuserpics.pl	2010-10-04 06:39:10 UTC (rev 17490)
@@ -98,6 +98,15 @@
         $idlist = [ $idlist ];
     }
 
+    ## avoid requesting upic multiple times.
+    ## otherwise memcached returns it multiple times too.
+    my %uniq = ();
+    $idlist = [ grep { 
+                        my $u = $_->[0];
+                        my $upicid = $_->[1];
+                        not $uniq{$u}->{$upicid}++ 
+                    } @$idlist ];
+
     my @load_list;
     foreach my $row (@{$idlist})
     {

Tags: livejournal, pl, 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