mirror of
https://github.com/friendica/friendica
synced 2024-12-22 17:20:16 +00:00
Merge pull request #14362 from annando/delete-apcontact
Remove apcontact and diaspora-contact entries that aren't connected to contacts
This commit is contained in:
commit
e500d588f7
1 changed files with 8 additions and 0 deletions
|
@ -89,5 +89,13 @@ class RemoveUnusedContacts
|
|||
}
|
||||
DBA::close($contacts);
|
||||
Logger::notice('Removal done', ['count' => $count, 'total' => $total]);
|
||||
|
||||
Logger::notice('Remove apcontact entries with no related contact');
|
||||
DBA::delete('apcontact', ["`uri-id` NOT IN (SELECT `uri-id` FROM `contact`) AND `updated` < ?", DateTimeFormat::utc('now - 30 days')]);
|
||||
Logger::notice('Removed apcontact entries with no related contact', ['count' => DBA::affectedRows()]);
|
||||
|
||||
Logger::notice('Remove diaspora-contact entries with no related contact');
|
||||
DBA::delete('diaspora-contact', ["`uri-id` NOT IN (SELECT `uri-id` FROM `contact`) AND `updated` < ?", DateTimeFormat::utc('now - 30 days')]);
|
||||
Logger::notice('Removed diaspora-contact entries with no related contact', ['count' => DBA::affectedRows()]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue