mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-11 09:34:26 +02:00
Reduce the amount of "UpdateContact" worker calls
This commit is contained in:
parent
4bb0fdc9a9
commit
e0e2e45b91
6 changed files with 89 additions and 18 deletions
|
@ -205,9 +205,15 @@ class Delivery
|
|||
*/
|
||||
private static function setSuccess(array $receivers, bool $success)
|
||||
{
|
||||
$gsid = null;
|
||||
$gsid = null;
|
||||
$update_counter = 0;
|
||||
|
||||
foreach ($receivers as $receiver) {
|
||||
// Only update the first 10 receivers to avoid flooding the remote system with requests
|
||||
if ($success && ($update_counter < 10) && Contact::updateByIdIfNeeded($receiver)) {
|
||||
$update_counter++;
|
||||
}
|
||||
|
||||
$contact = Contact::getById($receiver);
|
||||
if (empty($contact)) {
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue