summaryrefslogtreecommitdiff
path: root/classes/Notice_inbox.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2009-12-29 14:05:43 -0800
committerBrion Vibber <brion@pobox.com>2009-12-29 14:17:03 -0800
commit45c9d3d729a9c811282bdb9caa70450218200e8b (patch)
treecbf7cbd3e0e8b95df45e3e17e26c3a89f18e0ee8 /classes/Notice_inbox.php
parent360fdb219dde7cb46b919aa18826df8ce5f4fdc6 (diff)
Add progress output and optional --sleep-time parameter to triminboxes.php
Diffstat (limited to 'classes/Notice_inbox.php')
-rw-r--r--classes/Notice_inbox.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/classes/Notice_inbox.php b/classes/Notice_inbox.php
index b39006542..d3ddad656 100644
--- a/classes/Notice_inbox.php
+++ b/classes/Notice_inbox.php
@@ -106,6 +106,13 @@ class Notice_inbox extends Memcached_DataObject
return Memcached_DataObject::pkeyGet('Notice_inbox', $kv);
}
+ /**
+ * Trim inbox for a given user to latest NOTICE_INBOX_LIMIT items
+ * (up to NOTICE_INBOX_GC_MAX will be deleted).
+ *
+ * @param int $user_id
+ * @return int count of notices dropped from the inbox, if any
+ */
static function gc($user_id)
{
$entry = new Notice_inbox();
@@ -133,6 +140,8 @@ class Notice_inbox extends Memcached_DataObject
$notices = array();
}
}
+
+ return $total;
}
static function deleteMatching($user_id, $notices)