summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-06-03 14:50:52 -0400
committerEvan Prodromou <evan@status.net>2010-06-03 14:50:52 -0400
commit135b398d4bfd1d680c5ea3600337f79c113ed681 (patch)
treec3a253361491d0df0ee1854adda63acb104fb382 /classes
parenta5de2152672f49ad95f114033ef6bf00ece9a0ab (diff)
parent4bbb259baf93780556db398f50a22b6f245071e4 (diff)
Merge branch 'master' of gitorious.org:statusnet/mainline
Diffstat (limited to 'classes')
-rw-r--r--classes/Inbox.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/classes/Inbox.php b/classes/Inbox.php
index 2533210b7..430419ba5 100644
--- a/classes/Inbox.php
+++ b/classes/Inbox.php
@@ -115,9 +115,12 @@ class Inbox extends Memcached_DataObject
*/
static function insertNotice($user_id, $notice_id)
{
- $inbox = DB_DataObject::staticGet('inbox', 'user_id', $user_id);
-
- if (empty($inbox)) {
+ // Going straight to the DB rather than trusting our caching
+ // during an update. Note: not using DB_DataObject::staticGet,
+ // which is unsafe to use directly (in-process caching causes
+ // memory leaks, which accumulate in queue processes).
+ $inbox = new Inbox();
+ if (!$inbox->get('user_id', $user_id)) {
$inbox = Inbox::initialize($user_id);
}