X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FUpdateContacts.php;h=2beb890918538373c87a2e647ba567638da8cba9;hb=34030a736d5e0aa2195c0f472cf69f863c161d83;hp=b5ac862bda89706833458fe6fa2b6edd43cf0eeb;hpb=fae0f839bcefe431cd7e5fb355a7afc9e4bd0da4;p=friendica.git diff --git a/src/Worker/UpdateContacts.php b/src/Worker/UpdateContacts.php index b5ac862bda..2beb890918 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` WHERE `author-id` = `contact`.`id`)", @@ -65,7 +65,7 @@ class UpdateContacts $condition = DBA::mergeConditions($base_condition, [$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); + $ids = self::getContactsToUpdate($condition, $limit, $ids); Logger::info('Fetched interacting federated contacts', ['count' => count($ids), 'condition' => $contact_condition]); } @@ -80,7 +80,7 @@ class UpdateContacts ["(`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); + $ids = self::getContactsToUpdate($condition, $limit - $previous, $ids); Logger::info('Fetched federated contacts', ['count' => count($ids) - $previous]); } @@ -98,10 +98,11 @@ class UpdateContacts * Returns contact ids based on a given condition * * @param array $condition + * @param int $limit * @param array $ids * @return array contact ids */ - private static function getContactsToUpdate(array $condition, array $ids = [], int $limit) + private static function getContactsToUpdate(array $condition, int $limit, array $ids = []) { $contacts = DBA::select('contact', ['id'], $condition, ['limit' => $limit]); while ($contact = DBA::fetch($contacts)) {