]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
blow the cached streams for tags on a new notice
authorEvan Prodromou <evan@controlyourself.ca>
Sun, 28 Sep 2008 18:18:12 +0000 (14:18 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Sun, 28 Sep 2008 18:18:12 +0000 (14:18 -0400)
darcs-hash:20080928181812-5ed1f-708380f239b17b2a53b7279aa4a55af11156a5e8.gz

classes/Notice.php
classes/Notice_tag.php

index e72892966c22760d22e9fd1fcd8fac5af6841c6f..3402e2b307bba00c1cfd5676ad47a48f06f434de 100644 (file)
@@ -140,6 +140,22 @@ class Notice extends Memcached_DataObject
                $this->blowNoticeCache();
                $this->blowRepliesCache();
                $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() {
index e9f00d6d136ceb86d4e26a3d1e9684051ed8cf48..5ab6e332ab21d18986f6e5c431c5b9a2699b9176 100644 (file)
@@ -45,4 +45,11 @@ class Notice_tag extends Memcached_DataObject
                                                                 'notice_tag:notice_stream:' . $tag,
                                                                 $offset, $limit);
        }
+       
+       function blowCache() {
+               $cache = common_memcache();
+               if ($cache) {
+                       $cache->delete(common_cache_key('notice_tag:notice_stream:' . $this->tag));
+               }
+       }
 }