aboutsummaryrefslogtreecommitdiffstats
path: root/include/expire.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-06-10 16:59:04 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-06-10 16:59:04 -0700
commitca870dbf31d31455ab4f5e0f461c5af89e1573fa (patch)
tree30bf8c1a116828dc0272b5677b717f7721809b3b /include/expire.php
parent2128d5a2560383e0d3587087a7dd0aab217bc262 (diff)
downloadvolse-hubzilla-ca870dbf31d31455ab4f5e0f461c5af89e1573fa.tar.gz
volse-hubzilla-ca870dbf31d31455ab4f5e0f461c5af89e1573fa.tar.bz2
volse-hubzilla-ca870dbf31d31455ab4f5e0f461c5af89e1573fa.zip
more work on item table optimisation
Diffstat (limited to 'include/expire.php')
-rw-r--r--include/expire.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/expire.php b/include/expire.php
index 8ba9f746b..1af13163d 100644
--- a/include/expire.php
+++ b/include/expire.php
@@ -12,7 +12,7 @@ function expire_run($argv, $argc){
// perform final cleanup on previously delete items
- $r = q("select id from item where item_deleted = 1 and not (item_restrict & %d)>0 and changed < %s - INTERVAL %s",
+ $r = q("select id from item where item_deleted = 1 and item_pending_remove = 0 and changed < %s - INTERVAL %s",
intval(ITEM_PENDING_REMOVE),
db_utcnow(), db_quoteinterval('10 DAY')
);
@@ -25,8 +25,7 @@ function expire_run($argv, $argc){
// physically remove anything that has been deleted for more than two months
/** @FIXME - this is a wretchedly inefficient query */
- $r = q("delete from item where ( item_restrict & %d ) > 0 and changed < %s - INTERVAL %s",
- intval(ITEM_PENDING_REMOVE),
+ $r = q("delete from item where item_pending_remove = 1 and changed < %s - INTERVAL %s",
db_utcnow(), db_quoteinterval('36 DAY')
);