blow the cached streams for tags on a new notice
darcs-hash:20080928181812-5ed1f-708380f239b17b2a53b7279aa4a55af11156a5e8.gz
This commit is contained in:
parent
ddf2dce601
commit
11eed225b7
@ -140,6 +140,22 @@ class Notice extends Memcached_DataObject
|
|||||||
$this->blowNoticeCache();
|
$this->blowNoticeCache();
|
||||||
$this->blowRepliesCache();
|
$this->blowRepliesCache();
|
||||||
$this->blowPublicCache();
|
$this->blowPublicCache();
|
||||||
|
$this->blowTagCache();
|
||||||
|
}
|
||||||
|
|
||||||
|
function blowTagCache() {
|
||||||
|
$cache = common_memcache();
|
||||||
|
if ($cache) {
|
||||||
|
$tag = new Notice_tag();
|
||||||
|
$tag->notice_id = $this->id;
|
||||||
|
if ($tag->find()) {
|
||||||
|
while ($tag->fetch()) {
|
||||||
|
$tag->blowCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$tag->free();
|
||||||
|
unset($tag);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function blowSubsCache() {
|
function blowSubsCache() {
|
||||||
|
@ -45,4 +45,11 @@ class Notice_tag extends Memcached_DataObject
|
|||||||
'notice_tag:notice_stream:' . $tag,
|
'notice_tag:notice_stream:' . $tag,
|
||||||
$offset, $limit);
|
$offset, $limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function blowCache() {
|
||||||
|
$cache = common_memcache();
|
||||||
|
if ($cache) {
|
||||||
|
$cache->delete(common_cache_key('notice_tag:notice_stream:' . $this->tag));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user