From 83cbf246a871edc8da34a742af3b0ea37e100688 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 16 Jul 2009 00:26:51 -0400 Subject: use a soft limit so there's not a whole bunch of deletes on every write --- classes/Notice.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'classes/Notice.php') diff --git a/classes/Notice.php b/classes/Notice.php index e16d84352..0359c310d 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); -- cgit v1.2.3-54-g00ecf