X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FUpdateContacts.php;h=d7348b25861710cd115b9ec861d89d3f90532676;hb=deafdcde956b6fd973bf922abc9cb6d2ad66e880;hp=302e7fabdb9d21ab3a4ad51c623a608be1bc6421;hpb=1e996af3218baeec4d22f812accc09fb711f16fa;p=friendica.git diff --git a/src/Worker/UpdateContacts.php b/src/Worker/UpdateContacts.php index 302e7fabdb..d7348b2586 100644 --- a/src/Worker/UpdateContacts.php +++ b/src/Worker/UpdateContacts.php @@ -1,6 +1,6 @@ count($ids)]); - $conditions = ["`id` IN (SELECT `author-id` FROM `post-user`)", "`id` IN (SELECT `owner-id` FROM `post-user`)", - "`id` IN (SELECT `causer-id` FROM `post-user`)", "`id` IN (SELECT `cid` FROM `post-tag`)", - "`id` IN (SELECT `cid` FROM `user-contact`)"]; + $conditions = ["`id` IN (SELECT `author-id` FROM `post` WHERE `author-id` = `contact`.`id`)", + "`id` IN (SELECT `owner-id` FROM `post` WHERE `owner-id` = `contact`.`id`)", + "`id` IN (SELECT `causer-id` FROM `post` WHERE `causer-id` = `contact`.`id`)", + "`id` IN (SELECT `cid` FROM `post-tag` WHERE `cid` = `contact`.`id`)", + "`id` IN (SELECT `cid` FROM `user-contact` WHERE `cid` = `contact`.`id`)"]; foreach ($conditions as $contact_condition) { $condition = DBA::mergeConditions($base_condition, - [$contact_condition . " AND (`last-update` < ? OR (NOT `archive` AND `last-update` < ?))", + [$contact_condition . " AND (`last-update` < ? OR (NOT `failed` AND `last-update` < ?))", DateTimeFormat::utc('now - 1 month'), DateTimeFormat::utc('now - 1 week')]); $ids = self::getContactsToUpdate($condition, $ids, $limit); Logger::info('Fetched interacting federated contacts', ['count' => count($ids), 'condition' => $contact_condition]); @@ -75,7 +77,7 @@ class UpdateContacts // Add every contact (mostly failed ones) that hadn't been updated for six months // and every non failed contact that hadn't been updated for a month $condition = DBA::mergeConditions($base_condition, - ["(`last-update` < ? OR (NOT `archive` AND `last-update` < ?))", + ["(`last-update` < ? OR (NOT `failed` AND `last-update` < ?))", DateTimeFormat::utc('now - 6 month'), DateTimeFormat::utc('now - 1 month')]); $previous = count($ids); $ids = self::getContactsToUpdate($condition, $ids, $limit - $previous);