Alexander Nazarov (nfokz) wrote in changelog,
Alexander Nazarov
nfokz
changelog

[livejournal] r20251: LJSUP-10004: Criteria of not displaying ...

Committer: anazarov
LJSUP-10004: Criteria of not displaying advertisement in the journals
U   trunk/cgi-bin/LJ/User.pm
Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2011-10-07 10:06:06 UTC (rev 20250)
+++ trunk/cgi-bin/LJ/User.pm	2011-10-07 11:30:28 UTC (rev 20251)
@@ -5735,12 +5735,11 @@
     my $u = shift;
     my %opts = @_;
 
-    my $dbcr = $opts{dbh} || LJ::get_cluster_reader($u);
     my $userid = $u->id;
-
     my $memkey = [$userid, "talk2ct:$userid"];
     my $count = LJ::MemCache::get($memkey);
     unless ($count) {
+        my $dbcr = $opts{dbh} || LJ::get_cluster_reader($u);
         my $expire = time() + 3600*24*2; # 2 days;
         $count = $dbcr->selectrow_array("SELECT COUNT(*) FROM talk2 ".
                                         "WHERE journalid=?", undef, $userid);

Tags: anazarov, livejournal, nfokz, pm
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