mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-11 17:44:27 +02:00
Add debug for item deletion
This commit is contained in:
parent
b1b6533512
commit
25dceccf77
4 changed files with 10 additions and 5 deletions
|
@ -107,6 +107,7 @@ class DBClean {
|
|||
Logger::log("found global item orphans: ".$count);
|
||||
while ($orphan = DBA::fetch($r)) {
|
||||
$last_id = $orphan["id"];
|
||||
Logger::notice('Delete global orphan item', ['id' => $orphan["id"]]);
|
||||
DBA::delete('item', ['id' => $orphan["id"]]);
|
||||
}
|
||||
Worker::add(PRIORITY_MEDIUM, 'DBClean', 1, $last_id);
|
||||
|
@ -129,6 +130,7 @@ class DBClean {
|
|||
Logger::log("found item orphans without parents: ".$count);
|
||||
while ($orphan = DBA::fetch($r)) {
|
||||
$last_id = $orphan["id"];
|
||||
Logger::notice('Delete orphan item', ['id' => $orphan["id"]]);
|
||||
DBA::delete('item', ['id' => $orphan["id"]]);
|
||||
}
|
||||
Worker::add(PRIORITY_MEDIUM, 'DBClean', 2, $last_id);
|
||||
|
@ -326,6 +328,7 @@ class DBClean {
|
|||
Logger::log("found global item entries from expired threads: ".$count);
|
||||
while ($orphan = DBA::fetch($r)) {
|
||||
$last_id = $orphan["id"];
|
||||
Logger::notice('Delete expired thread item', ['id' => $orphan["id"]]);
|
||||
DBA::delete('item', ['id' => $orphan["id"]]);
|
||||
}
|
||||
Worker::add(PRIORITY_MEDIUM, 'DBClean', 9, $last_id);
|
||||
|
|
|
@ -45,6 +45,7 @@ class Expire
|
|||
$condition = ["`deleted` AND `changed` < UTC_TIMESTAMP() - INTERVAL 60 DAY"];
|
||||
$rows = DBA::select('item', ['id'], $condition);
|
||||
while ($row = DBA::fetch($rows)) {
|
||||
Logger::notice('Delete expired item', ['id' => $row["id"]]);
|
||||
DBA::delete('item', ['id' => $row['id']]);
|
||||
}
|
||||
DBA::close($rows);
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
namespace Friendica\Worker;
|
||||
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Model\Item;
|
||||
|
@ -42,6 +43,7 @@ class RemoveContact {
|
|||
do {
|
||||
$items = Item::select(['id'], $condition, ['limit' => 100]);
|
||||
while ($item = Item::fetch($items)) {
|
||||
Logger::notice('Delete removed contact item', ['id' => $item["id"]]);
|
||||
DBA::delete('item', ['id' => $item['id']]);
|
||||
}
|
||||
DBA::close($items);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue