aboutsummaryrefslogtreecommitdiffstats
path: root/include/expire.php
diff options
context:
space:
mode:
authorhabeascodice <habeascodice@federated.social>2014-11-13 13:30:29 -0800
committerhabeascodice <habeascodice@federated.social>2014-11-13 13:30:29 -0800
commit2dbecf95454993cdf4996d2d65463d7759cd479b (patch)
treecbef39a4779efed1c0ab3b61a9ff09e37fadb49e /include/expire.php
parentbc02b933727da7a000d43d2d7d495f066616dc81 (diff)
parentac27db22c18ee7a82a52cbadb3efe2760b910499 (diff)
downloadvolse-hubzilla-2dbecf95454993cdf4996d2d65463d7759cd479b.tar.gz
volse-hubzilla-2dbecf95454993cdf4996d2d65463d7759cd479b.tar.bz2
volse-hubzilla-2dbecf95454993cdf4996d2d65463d7759cd479b.zip
Merge branch 'master' of https://github.com/habeascodice/red
Diffstat (limited to 'include/expire.php')
-rw-r--r--include/expire.php10
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