mirror of
https://github.com/friendica/friendica
synced 2025-04-28 13:04:23 +02:00
New "post-user" structure, new update functionality
This commit is contained in:
parent
a7791bebc2
commit
9a9674d5fb
8 changed files with 200 additions and 69 deletions
|
@ -27,6 +27,7 @@ use Friendica\Core\Worker;
|
|||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Post;
|
||||
|
||||
/**
|
||||
* Expires old item entries
|
||||
|
@ -43,10 +44,11 @@ class Expire
|
|||
Logger::log('Delete expired items', Logger::DEBUG);
|
||||
// physically remove anything that has been deleted for more than two months
|
||||
$condition = ["`deleted` AND `changed` < UTC_TIMESTAMP() - INTERVAL 60 DAY"];
|
||||
$rows = DBA::select('item', ['id', 'guid'], $condition);
|
||||
$rows = DBA::select('item', ['id', 'guid', 'uri-id', 'uid'], $condition);
|
||||
while ($row = DBA::fetch($rows)) {
|
||||
Logger::info('Delete expired item', ['id' => $row['id'], 'guid' => $row['guid']]);
|
||||
DBA::delete('item', ['id' => $row['id']]);
|
||||
Post\User::delete(['uri-id' => $row['uri-id'], 'uid' => $row['uid']]);
|
||||
}
|
||||
DBA::close($rows);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue