madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r22370: LJSUP-12772: Support patch for db update...

Committer: sbelyaev
LJSUP-12772: Support patch for db update (r94 adding new row into repost2)
U   trunk/cgi-bin/LJ/Entry/Repost.pm
Modified: trunk/cgi-bin/LJ/Entry/Repost.pm
===================================================================
--- trunk/cgi-bin/LJ/Entry/Repost.pm	2012-07-03 08:33:13 UTC (rev 22369)
+++ trunk/cgi-bin/LJ/Entry/Repost.pm	2012-07-03 08:54:20 UTC (rev 22370)
@@ -71,13 +71,13 @@
     my ($u, $itemid, $repost_journalid, $repost_itemid) = @_;
 
     my $journalid = $u->userid;
-
+    my $time  = time();
     my $query = 'INSERT INTO repost2(journalid,
                                     jitemid,
                                     reposterid,
                                     reposted_jitemid';
     $query .= LJ::is_enabled('repost2_with_time') ? 
-                            ',repost_time) VALUES(?,?,?,?,NOW())' :
+                            ',repost_time) VALUES(?,?,?,?,?)' :
                             ') VALUES(?,?,?,?)'; 
                                     
     $u->do( $query,
@@ -85,7 +85,8 @@
             $u->userid,
             $itemid,
             $repost_journalid,
-            $repost_itemid, );
+            $repost_itemid,
+            $time );
 
     my $memcache_key_count = "reposted_count:$journalid:$itemid";
     my $memcache_key_status = "reposted_itemid:$journalid:$itemid:$repost_journalid";
@@ -236,7 +237,7 @@
     my $memcached_key_list = "reposters_keys_list:$subkey";
 
     my ($keys_list) = LJ::MemCache::get($memcached_key_list) ;
-    if (length $keys_list) {
+    if (defined $keys_list) {
         my @keys = split(/:/, $keys_list);
         foreach my $key (@keys) {
             my $memcache_key = "reposters_list_chunk:$subkey:$key";

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