memoize Notice::whoGets()
This commit is contained in:
parent
f05ae1f210
commit
3d579fc580
@ -828,6 +828,15 @@ class Notice extends Memcached_DataObject
|
||||
|
||||
function whoGets()
|
||||
{
|
||||
$c = self::memcache();
|
||||
|
||||
if (!empty($c)) {
|
||||
$ni = $c->get(common_cache_key('notice:who_gets:'.$this->id));
|
||||
if ($ni !== false) {
|
||||
return $ni;
|
||||
}
|
||||
}
|
||||
|
||||
$users = $this->getSubscribedUsers();
|
||||
|
||||
// FIXME: kind of ignoring 'transitional'...
|
||||
@ -867,6 +876,11 @@ class Notice extends Memcached_DataObject
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($c)) {
|
||||
// XXX: pack this data better
|
||||
$c->set(common_cache_key('notice:who_gets:'.$this->id), $ni);
|
||||
}
|
||||
|
||||
return $ni;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user