aboutsummaryrefslogtreecommitdiffstats
path: root/include/expire.php
diff options
context:
space:
mode:
authorRedMatrix <info@friendica.com>2014-11-14 08:52:38 +1100
committerRedMatrix <info@friendica.com>2014-11-14 08:52:38 +1100
commit9132a1c1954bcdeb3a7356212e2c8982e5878bbd (patch)
treeaa7002d73dbcd4136033589f1cb135184f4126c1 /include/expire.php
parent109cb936632c693d3f24afb9e2ce533797ad1a7f (diff)
parentac27db22c18ee7a82a52cbadb3efe2760b910499 (diff)
downloadvolse-hubzilla-9132a1c1954bcdeb3a7356212e2c8982e5878bbd.tar.gz
volse-hubzilla-9132a1c1954bcdeb3a7356212e2c8982e5878bbd.tar.bz2
volse-hubzilla-9132a1c1954bcdeb3a7356212e2c8982e5878bbd.zip
Merge pull request #690 from habeascodice/master
Initial postgres support
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