aboutsummaryrefslogtreecommitdiffstats
path: root/include/expire.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-03-24 17:09:42 -0700
committerfriendica <info@friendica.com>2015-03-24 17:09:42 -0700
commit63b8020969434756a7b966ae615c28bf7680f2f8 (patch)
tree0999882404277cb496fa713fcc2481b26541759e /include/expire.php
parent1f427e0e5b3a5526625e90d43746c89953ab493a (diff)
downloadvolse-hubzilla-63b8020969434756a7b966ae615c28bf7680f2f8.tar.gz
volse-hubzilla-63b8020969434756a7b966ae615c28bf7680f2f8.tar.bz2
volse-hubzilla-63b8020969434756a7b966ae615c28bf7680f2f8.zip
more work on expiration, make system limits useful - even in retrospect
Diffstat (limited to 'include/expire.php')
-rw-r--r--include/expire.php34
1 files changed, 25 insertions, 9 deletions
diff --git a/include/expire.php b/include/expire.php
index 9ef0f7b69..e414a6e7d 100644
--- a/include/expire.php
+++ b/include/expire.php
@@ -38,6 +38,9 @@ function expire_run($argv, $argc){
logger('expire: start', LOGGER_DEBUG);
$site_expire = get_config('system', 'default_expire_days');
+
+ logger('site_expire: ' . $site_expire);
+
if(intval($site_expire)) {
$r = q("SELECT channel_id, channel_address, channel_pageflags, channel_expire_days from channel where true");
}
@@ -52,15 +55,18 @@ function expire_run($argv, $argc){
if($rr['channel_pageflags'] & PAGE_SYSTEM)
continue;
+ if(intval($site_expire) && (intval($site_expire) < intval($rr['channel_expire_days'])) ||
+ intval($rr['channel_expire_days'] == 0)) {
+ $expire_days = $site_expire;
+ }
+ else {
+ $expire_days = $rr['channel_expire_days'];
+ }
+
+
// if the site expiration is non-zero and less than person expiration, use that
- logger('Expire: ' . $rr['channel_address'] . ' interval: ' . ((intval($site_expire) && intval($site_expire) < intval($rr['channel_expire_days']))
- ? $site_expire
- : $rr['channel_expire_days']), LOGGER_DEBUG);
- item_expire($rr['channel_id'],
- ((intval($site_expire) && intval($site_expire) < intval($rr['channel_expire_days']))
- ? $site_expire
- : $rr['channel_expire_days'])
- );
+ logger('Expire: ' . $rr['channel_address'] . ' interval: ' . $expire_days, LOGGER_DEBUG);
+ item_expire($rr['channel_id'], $expire_days);
}
}
@@ -74,8 +80,18 @@ function expire_run($argv, $argc){
$expire_days = get_config('system','sys_expire_days');
if($expire_days === false)
$expire_days = 30;
+
+ if(intval($site_expire) && (intval($site_expire) < intval($expire_days))) {
+ $expire_days = $site_expire;
+ }
+
+ logger('Expire: sys interval: ' . $expire_days, LOGGER_DEBUG);
+
if($expire_days)
- item_expire($x['channel_id'],(($site_expire && $site_expire < $expire_days) ? $site_expire : $expire_days));
+ item_expire($x['channel_id'],$expire_days);
+
+ logger('Expire: sys: done', LOGGER_DEBUG);
+
}
return;