wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r20818: LJSUP-10492: Incorrect working autosave ...

Committer: wisest-owl
LJSUP-10492: Incorrect working autosave for second time

U   trunk/cgi-bin/LJ/User/PropStorage.pm
U   trunk/cgi-bin/LJ/User.pm
Modified: trunk/cgi-bin/LJ/User/PropStorage.pm
===================================================================
--- trunk/cgi-bin/LJ/User/PropStorage.pm	2011-12-20 11:13:44 UTC (rev 20817)
+++ trunk/cgi-bin/LJ/User/PropStorage.pm	2011-12-20 13:27:03 UTC (rev 20818)
@@ -73,6 +73,16 @@
     Carp::croak $class . 'does not have a "memcache_key" method defined';
 }
 
+sub delete_prop_memcache {
+    my ( $class, $u, $props ) = @_;
+
+    my $memkey = $class->memcache_key ($u, $props);
+
+    my $userid = int $u->userid;
+
+    LJ::MemCache::delete ([ $userid, $memkey ]);
+}
+
 sub fetch_props_memcache {
     my ( $class, $u, $props ) = @_;
 

Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2011-12-20 11:13:44 UTC (rev 20817)
+++ trunk/cgi-bin/LJ/User.pm	2011-12-20 13:27:03 UTC (rev 20818)
@@ -3008,9 +3008,11 @@
 
 sub uncache_prop {
     my ($u, $name) = @_;
-    my $prop = LJ::get_prop("user", $name) or die; # FIXME: use exceptions
-    LJ::MemCache::delete([$u->{userid}, "uprop:$u->{userid}:$prop->{id}"]);
+    
+    my $handler = LJ::User::PropStorage->get_handler ($name);
+    $handler->delete_prop_memcache ($u, $name);
     delete $u->{$name};
+
     return 1;
 }
 

Tags: livejournal, pm, wisest-owl
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