aboutsummaryrefslogtreecommitdiffstats
path: root/include/expire.php
diff options
context:
space:
mode:
authortony baldwin <tony@tonybaldwin.org>2014-04-12 08:37:56 -0400
committertony baldwin <tony@tonybaldwin.org>2014-04-12 08:37:56 -0400
commitebd33b185da1c36e718dfa4a2971c3db35cbda22 (patch)
treec23cbf55aac433c90ac254d0684dabf9d4528133 /include/expire.php
parent5cca00ddc79dad667464674e08a2a860e262eabd (diff)
parentd0834c7e1394e1986b2b00e039125deff74d9e5e (diff)
downloadvolse-hubzilla-ebd33b185da1c36e718dfa4a2971c3db35cbda22.tar.gz
volse-hubzilla-ebd33b185da1c36e718dfa4a2971c3db35cbda22.tar.bz2
volse-hubzilla-ebd33b185da1c36e718dfa4a2971c3db35cbda22.zip
Merge remote-tracking branch 'upstream/master'
Conflicts: view/theme/redbasic/css/style.css whatever
Diffstat (limited to 'include/expire.php')
-rw-r--r--include/expire.php29
1 files changed, 27 insertions, 2 deletions
diff --git a/include/expire.php b/include/expire.php
index f1002b890..442914a39 100644
--- a/include/expire.php
+++ b/include/expire.php
@@ -7,10 +7,20 @@ 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",
+ intval(ITEM_DELETED),
+ intval(ITEM_PENDING_REMOVE)
+ );
+ if($r) {
+ foreach($r as $rr) {
+ drop_item($rr['id'],false,DROPITEM_PHASE2);
+ }
+ }
+
// physically remove anything that has been deleted for more than two months
- $r = q("delete from item where item_flags & %d and changed < UTC_TIMESTAMP() - INTERVAL 60 DAY",
- intval(ITEM_DELETED)
+ $r = q("delete from item where ( item_restrict & %d ) and changed < UTC_TIMESTAMP() - INTERVAL 36 DAY",
+ intval(ITEM_PENDING_REMOVE)
);
// make this optional as it could have a performance impact on large sites
@@ -29,6 +39,21 @@ function expire_run($argv, $argc){
}
}
+
+ $x = get_sys_channel();
+ if($x) {
+
+ // this should probably just fetch the channel_expire_days from the sys channel,
+ // but there's no convenient way to set it.
+
+ $expire_days = get_config('externals','expire_days');
+ if($expire_days === false)
+ $expire_days = 30;
+ if($expire_days)
+ item_expire($x['channel_id'],$expire_days);
+ }
+
+
return;
}