diff options
author | habeascodice <habeascodice@federated.social> | 2014-11-17 08:30:26 -0800 |
---|---|---|
committer | habeascodice <habeascodice@federated.social> | 2014-11-17 08:30:26 -0800 |
commit | 540b7af2c12666047710dd8f5e0c54d23ae8872c (patch) | |
tree | ea90f72d9d308f6cb061a528c1f8494106e70087 /include/expire.php | |
parent | 80eb84e843cdca51bbf4ebda180f4de41351b9c4 (diff) | |
parent | ee38bebbd6a641eb953eacf493c085053442d972 (diff) | |
download | volse-hubzilla-540b7af2c12666047710dd8f5e0c54d23ae8872c.tar.gz volse-hubzilla-540b7af2c12666047710dd8f5e0c54d23ae8872c.tar.bz2 volse-hubzilla-540b7af2c12666047710dd8f5e0c54d23ae8872c.zip |
Merge branch 'master' of https://github.com/habeascodice/red
Diffstat (limited to 'include/expire.php')
-rw-r--r-- | include/expire.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/expire.php b/include/expire.php index 442914a39..a229bd4ac 100644 --- a/include/expire.php +++ b/include/expire.php @@ -7,9 +7,10 @@ function expire_run($argv, $argc){ cli_startup(); - $r = q("select id from item where (item_restrict & %d) and not (item_restrict & %d) and changed < UTC_TIMESTAMP() - INTERVAL 10 DAY", + $r = q("select id from item where (item_restrict & %d)>0 and not (item_restrict & %d)>0 and changed < %s - INTERVAL %s", intval(ITEM_DELETED), - intval(ITEM_PENDING_REMOVE) + intval(ITEM_PENDING_REMOVE), + db_utcnow(), db_quoteinterval('10 DAY') ); if($r) { foreach($r as $rr) { @@ -19,8 +20,9 @@ function expire_run($argv, $argc){ // physically remove anything that has been deleted for more than two months - $r = q("delete from item where ( item_restrict & %d ) and changed < UTC_TIMESTAMP() - INTERVAL 36 DAY", - intval(ITEM_PENDING_REMOVE) + $r = q("delete from item where ( item_restrict & %d )>0 and changed < %s - INTERVAL %s", + intval(ITEM_PENDING_REMOVE), + db_utcnow(), db_quoteinterval('36 DAY') ); // make this optional as it could have a performance impact on large sites |