summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-09-28 15:46:14 -0700
committerZach Copley <zach@status.net>2010-09-28 15:46:14 -0700
commit78a711d5566e7bf2347199f034641f44b36f6e09 (patch)
tree50a3656cd248d85a18b0207a1ab4652e86852a2e
parentd684a07fd93fe46c6195b0aeb56fcf01812ef60d (diff)
Move blowFavesCache() to Profile
-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 1a54489ed..9753b278e 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -552,6 +552,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()