From: Evan Prodromou Date: Thu, 16 Jul 2009 04:26:51 +0000 (-0400) Subject: use a soft limit so there's not a whole bunch of deletes on every write X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=83cbf246a871edc8da34a742af3b0ea37e100688;p=quix0rs-gnu-social.git use a soft limit so there's not a whole bunch of deletes on every write --- diff --git a/classes/Notice.php b/classes/Notice.php index e16d84352f..0359c310d4 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -875,7 +875,9 @@ class Notice extends Memcached_DataObject } $qry .= '('.$id.', '.$this->id.', '.$source.', "'.$this->created.'") '; $cnt++; - Notice_inbox::gc($id); + if (rand() % NOTICE_INBOX_SOFT_LIMIT == 0) { + Notice_inbox::gc($id); + } if ($cnt >= MAX_BOXCARS) { $inbox = new Notice_inbox(); $inbox->query($qry); diff --git a/classes/Notice_inbox.php b/classes/Notice_inbox.php index a1aa9b0549..2af34b1a46 100644 --- a/classes/Notice_inbox.php +++ b/classes/Notice_inbox.php @@ -27,6 +27,7 @@ define('INBOX_CACHE_WINDOW', 101); define('NOTICE_INBOX_GC_BOXCAR', 128); define('NOTICE_INBOX_GC_MAX', 12800); define('NOTICE_INBOX_LIMIT', 1000); +define('NOTICE_INBOX_SOFT_LIMIT', 1000); define('NOTICE_INBOX_SOURCE_SUB', 1); define('NOTICE_INBOX_SOURCE_GROUP', 2);