X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FInbox.php;h=a1ab6215fd3a018cfcd2724522443e1fbb8d888f;hb=dbb95b76a4d384fd62fd24b4d427baefd007cb90;hp=2533210b731a73899dbb7fb65cb41d49b8b6bcc9;hpb=ec24f283dd6f1371125c042529f571645a5f13fa;p=quix0rs-gnu-social.git diff --git a/classes/Inbox.php b/classes/Inbox.php index 2533210b73..a1ab6215fd 100644 --- a/classes/Inbox.php +++ b/classes/Inbox.php @@ -55,7 +55,6 @@ class Inbox extends Memcached_DataObject /** * Create a new inbox from existing Notice_inbox stuff */ - static function initialize($user_id) { $inbox = Inbox::fromNoticeInbox($user_id); @@ -115,9 +114,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); }