]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Inbox.php
Localisation updates from http://translatewiki.net
[quix0rs-gnu-social.git] / classes / Inbox.php
index 2533210b731a73899dbb7fb65cb41d49b8b6bcc9..430419ba5ef9fc0d5ab5f0c091f805d8fdf01064 100644 (file)
@@ -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);
         }