cache getReplies() values
This commit is contained in:
parent
419ae3f18d
commit
f9dc2fc0ab
@ -1208,8 +1208,13 @@ class Notice extends Memcached_DataObject
|
||||
*/
|
||||
function getReplies()
|
||||
{
|
||||
// XXX: cache me
|
||||
$keypart = sprintf('notice:reply_ids:%d', $this->id);
|
||||
|
||||
$idstr = self::cacheGet($keypart);
|
||||
|
||||
if ($idstr !== false) {
|
||||
$ids = explode(',', $idstr);
|
||||
} else {
|
||||
$ids = array();
|
||||
|
||||
$reply = new Reply();
|
||||
@ -1222,8 +1227,8 @@ class Notice extends Memcached_DataObject
|
||||
$ids[] = $reply->profile_id;
|
||||
}
|
||||
}
|
||||
|
||||
$reply->free();
|
||||
self::cacheSet($keypart, implode(',', $ids));
|
||||
}
|
||||
|
||||
return $ids;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user