Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[ljcom] r8325: LJSV-1024 (Comment count on profile does...

Committer: ailyin
LJSV-1024 (Comment count on profile does not increase)

U   trunk/cgi-bin/LJ/UserManage.pm
Modified: trunk/cgi-bin/LJ/UserManage.pm
===================================================================
--- trunk/cgi-bin/LJ/UserManage.pm	2010-03-22 11:10:35 UTC (rev 8324)
+++ trunk/cgi-bin/LJ/UserManage.pm	2010-03-22 11:20:49 UTC (rev 8325)
@@ -141,53 +141,7 @@
     'subs' => { 'copy_policy' => 'chunks', 'id' => 'subid' },
     'subsprop' => 'ignore',
     'talk2' => { 'copy_policy' => 'chunks', 'userid' => 'journalid', 'id' => 'jtalkid' },
-    'talkleft' => {
-        'copy_policy' => sub {
-            my ($userid, $sclust, $dclust, $sdbh, $ddbh) = @_;
-
-            my $u = LJ::want_user($userid);
-            $u->set_prop('talkleftct', $sdbh->selectrow_array(qq{
-                SELECT COUNT(*) FROM talkleft WHERE userid=?
-            }, undef, $userid)) unless $u->prop('talkleftct');
-
-            my $cleared = $ddbh->do(qq{
-                DELETE FROM talkleft WHERE userid = ?
-            }, undef, $userid);
-
-            debug_msg sprintf("cleared %d items from dcluster\n", $cleared)
-                if $cleared;
-
-            my $sth = $sdbh->prepare(qq{
-                SELECT * FROM talkleft
-                WHERE userid=? ORDER BY posttime DESC
-                LIMIT 1000
-            }, { 'mysql_use_result' => 1 });
-
-            $sth->execute($userid);
-
-            my $counter = 0;
-
-            while (my $row = $sth->fetchrow_hashref()) {
-                my (@sets, @binds);
-
-                foreach my $k (keys %$row) {
-                    push @sets, "$k=?";
-                    push @binds, $row->{$k};
-                }
-
-                my $sets = join(', ', @sets);
-
-                my $affected = $ddbh->do(
-                    "INSERT INTO talkleft SET $sets", undef, @binds
-                );
-                $counter += ($affected ? 1 : 0);
-            }
-
-            $sth->finish;
-
-            debug_msg "copied $counter talkleft rows between clusters\n";
-        },
-    },
+    'talkleft' => { 'copy_policy' => 'chunks', 'id' => 'posttime' },
     'talkprop2' => { 'copy_policy' => 'chunks', 'userid' => 'journalid', 'id' => 'jtalkid' },
     'talktext2' => { 'copy_policy' => 'chunks', 'userid' => 'journalid', 'id' => 'jtalkid', 'size' => 100 },
     'tempanonips' => { 'copy_policy' => 'chunks', 'userid' => 'journalid', 'id' => 'jtalkid' },

Tags: andy, ljcom, 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