diff options
author | Evan Prodromou <evan@status.net> | 2010-02-03 12:31:25 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-02-03 12:31:25 -0500 |
commit | dbeb388adefec94c3bb34e99305a004d845b719c (patch) | |
tree | d23d0e9af6b313d63c6f9c2b08d90de34a38b6bc /classes/Notice.php | |
parent | 0e0beea5aa75e58de251752b2720d4ea6a8c89f7 (diff) |
clear cache for Profile::hasRepeated() at Notice::insert() time
Diffstat (limited to 'classes/Notice.php')
-rw-r--r-- | classes/Notice.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index 42878d94f..f9f386357 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1468,4 +1468,25 @@ class Notice extends Memcached_DataObject $handler->handle($this); } } + + function insert() + { + $result = parent::insert(); + + if ($result) { + // Profile::hasRepeated() abuses pkeyGet(), so we + // have to clear manually + if (!empty($this->repeat_of)) { + $c = self::memcache(); + if (!empty($c)) { + $ck = self::multicacheKey('Notice', + array('profile_id' => $this->profile_id, + 'repeat_of' => $this->repeat_of)); + $c->delete($ck); + } + } + } + + return $result; + } } |