From: Zach Copley Date: Tue, 28 Sep 2010 22:46:14 +0000 (-0700) Subject: Move blowFavesCache() to Profile X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3960c9ad39d96cdfef390065f15f9f0fc280f37c;p=quix0rs-gnu-social.git Move blowFavesCache() to Profile --- diff --git a/classes/Profile.php b/classes/Profile.php index 668f25d2e4..3844077e62 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -551,6 +551,20 @@ class Profile extends Memcached_DataObject return $cnt; } + function blowFavesCache() + { + $cache = common_memcache(); + if ($cache) { + // Faves don't happen chronologically, so we need to blow + // ;last cache, too + $cache->delete(common_cache_key('fave:ids_by_user:'.$this->id)); + $cache->delete(common_cache_key('fave:ids_by_user:'.$this->id.';last')); + $cache->delete(common_cache_key('fave:ids_by_user_own:'.$this->id)); + $cache->delete(common_cache_key('fave:ids_by_user_own:'.$this->id.';last')); + } + $this->blowFaveCount(); + } + function blowSubscriberCount() { $c = common_memcache(); diff --git a/classes/User.php b/classes/User.php index 27299e62e0..e784fd9e9a 100644 --- a/classes/User.php +++ b/classes/User.php @@ -482,17 +482,8 @@ class User extends Memcached_DataObject function blowFavesCache() { - $cache = common_memcache(); - if ($cache) { - // Faves don't happen chronologically, so we need to blow - // ;last cache, too - $cache->delete(common_cache_key('fave:ids_by_user:'.$this->id)); - $cache->delete(common_cache_key('fave:ids_by_user:'.$this->id.';last')); - $cache->delete(common_cache_key('fave:ids_by_user_own:'.$this->id)); - $cache->delete(common_cache_key('fave:ids_by_user_own:'.$this->id.';last')); - } $profile = $this->getProfile(); - $profile->blowFaveCount(); + $profile->blowFavesCache(); } function getSelfTags()