diff options
author | friendica <info@friendica.com> | 2014-03-27 20:28:48 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-03-27 20:28:48 -0700 |
commit | a6d8668a5f31def1a74fcdfe15a184acfe3d696d (patch) | |
tree | d58f65fb2cf1bfc8347478757f9c3dedeb5c6cab /include/expire.php | |
parent | 8c3efd20f4a56517d714bc533549251f41308d7e (diff) | |
download | volse-hubzilla-a6d8668a5f31def1a74fcdfe15a184acfe3d696d.tar.gz volse-hubzilla-a6d8668a5f31def1a74fcdfe15a184acfe3d696d.tar.bz2 volse-hubzilla-a6d8668a5f31def1a74fcdfe15a184acfe3d696d.zip |
try and sort out the item delete mess
Diffstat (limited to 'include/expire.php')
-rw-r--r-- | include/expire.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/expire.php b/include/expire.php index efce64ee4..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 @@ -42,6 +52,8 @@ function expire_run($argv, $argc){ if($expire_days) item_expire($x['channel_id'],$expire_days); } + + return; } |