summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-09-28 15:46:14 -0700
committerZach Copley <zach@status.net>2010-09-29 16:35:12 -0700
commit3960c9ad39d96cdfef390065f15f9f0fc280f37c (patch)
tree48d080155b6e1836b8ac33dfb20c87ed1b534d83 /classes
parentc19e592fa80f616a18718c4650ea0ffc9661f7ce (diff)
Move blowFavesCache() to Profile
Diffstat (limited to 'classes')
-rw-r--r--classes/Profile.php14
-rw-r--r--classes/User.php11
2 files changed, 15 insertions, 10 deletions
diff --git a/classes/Profile.php b/classes/Profile.php
index 668f25d2e..3844077e6 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 27299e62e..e784fd9e9 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()