]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
use a soft limit so there's not a whole bunch of deletes on every write
authorEvan Prodromou <evan@controlyourself.ca>
Thu, 16 Jul 2009 04:26:51 +0000 (00:26 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Thu, 16 Jul 2009 04:26:51 +0000 (00:26 -0400)
classes/Notice.php
classes/Notice_inbox.php

index e16d84352f07019d5beff65b7744642e1eb68185..0359c310d4b82237e2d43d7dfe648e01af4aa39b 100644 (file)
@@ -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);
index a1aa9b05498c3c0eacdb97b7c9c835b40bbdee1f..2af34b1a4659a47c81731afc67afe975d6f784ca 100644 (file)
@@ -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);