Browse Source

Improve query speed

pull/6016/head
Michael 3 years ago
parent
commit
a6f6db8d4e
  1. 6
      src/Worker/RemoveContact.php

6
src/Worker/RemoveContact.php

@ -16,13 +16,13 @@ class RemoveContact {
// Only delete if the contact is to be deleted
$condition = ['network' => Protocol::PHANTOM, 'id' => $id];
$r = DBA::exists('contact', $condition);
if (!DBA::isResult($r)) {
$contact = DBA::selectFirst('contact', ['uid'], $condition);
if (!DBA::isResult($contact)) {
return;
}
// Now we delete the contact and all depending tables
$condition = ['contact-id' => $id];
$condition = ['uid' => $contact['uid'], 'contact-id' => $id];
do {
$items = Item::select(['id'], $condition, ['limit' => 100]);
while ($item = Item::fetch($items)) {

Loading…
Cancel
Save