aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Expire.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Daemon/Expire.php')
-rw-r--r--Zotlabs/Daemon/Expire.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/Zotlabs/Daemon/Expire.php b/Zotlabs/Daemon/Expire.php
index 6ab67150f..dae585578 100644
--- a/Zotlabs/Daemon/Expire.php
+++ b/Zotlabs/Daemon/Expire.php
@@ -2,6 +2,8 @@
namespace Zotlabs\Daemon;
+use Zotlabs\Lib\Config;
+
require_once('include/items.php');
class Expire {
@@ -10,24 +12,24 @@ class Expire {
cli_startup();
- $pid = get_config('procid', 'expire', false);
+ $pid = Config::Get('procid', 'expire', false);
if ($pid && (function_exists('posix_kill') ? posix_kill($pid, 0) : true)) {
logger('procedure already run with pid ' . $pid, LOGGER_DEBUG);
return;
}
$pid = getmypid();
- set_config('procid', 'expire', $pid);
+ Config::Set('procid', 'expire', $pid);
// perform final cleanup on previously delete items
- $r = q("select id from item where item_deleted = 1 and item_pending_remove = 0 and changed < %s - INTERVAL %s",
+ $r = q("select id, uid from item where item_deleted = 1 and item_pending_remove = 0 and changed < %s - INTERVAL %s",
db_utcnow(),
db_quoteinterval('10 DAY')
);
if ($r) {
foreach ($r as $rr) {
- drop_item($rr['id'], false, DROPITEM_PHASE2);
+ drop_item($rr['id'], DROPITEM_PHASE2, uid: $rr['uid']);
}
}
@@ -38,13 +40,13 @@ class Expire {
db_quoteinterval('36 DAY')
);
- if (intval(get_config('system', 'optimize_items')))
+ if (intval(Config::Get('system', 'optimize_items')))
q("optimize table item");
logger('expire: start with pid ' . $pid, LOGGER_DEBUG);
- $site_expire = intval(get_config('system', 'default_expire_days', 30));
- $commented_days = intval(get_config('system', 'active_expire_days', 7));
+ $site_expire = intval(Config::Get('system', 'default_expire_days', 30));
+ $commented_days = intval(Config::Get('system', 'active_expire_days', 7));
logger('site_expire: ' . $site_expire);
@@ -84,7 +86,7 @@ class Expire {
// 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('system', 'sys_expire_days');
+ $expire_days = Config::Get('system', 'sys_expire_days');
if ($expire_days === false)
$expire_days = 30;
@@ -101,7 +103,7 @@ class Expire {
logger('Expire: sys: done', LOGGER_DEBUG);
}
- del_config('procid', 'expire');
+ Config::Delete('procid', 'expire');
return;
}