forked from GNUsocial/gnu-social
cache getReplies() values
This commit is contained in:
parent
419ae3f18d
commit
f9dc2fc0ab
@ -1208,8 +1208,13 @@ class Notice extends Memcached_DataObject
|
|||||||
*/
|
*/
|
||||||
function getReplies()
|
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();
|
$ids = array();
|
||||||
|
|
||||||
$reply = new Reply();
|
$reply = new Reply();
|
||||||
@ -1222,8 +1227,8 @@ class Notice extends Memcached_DataObject
|
|||||||
$ids[] = $reply->profile_id;
|
$ids[] = $reply->profile_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
self::cacheSet($keypart, implode(',', $ids));
|
||||||
$reply->free();
|
}
|
||||||
|
|
||||||
return $ids;
|
return $ids;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user