X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FUpdateContacts.php;h=6fb71eec383fff892fea758f28e99343589372c4;hb=131695cb1167a831dbe87a0f2b1bde755dabd55f;hp=881418dc11f6f3cfed82add4c1188d199ab0cf8d;hpb=689b6b015b84da4b8ce2bdb2389093e5d104b2c9;p=friendica.git diff --git a/src/Worker/UpdateContacts.php b/src/Worker/UpdateContacts.php index 881418dc11..6fb71eec38 100644 --- a/src/Worker/UpdateContacts.php +++ b/src/Worker/UpdateContacts.php @@ -1,6 +1,6 @@ $contact['id'], 'count' => $count, 'duration' => round((float)microtime(true) - $stamp, 3), 'success' => $success]); - ++$count; - } elseif (Worker::add(['priority' => Worker::PRIORITY_LOW, 'dont_fork' => true], 'UpdateContact', $contact['id'])) { - Logger::debug('Update by worker', ['id' => $contact['id'], 'count' => $count]); - ++$count; + + try { + if ((!empty($contact['gsid']) || !empty($contact['baseurl'])) && GServer::reachable($contact)) { + $stamp = (float)microtime(true); + $success = Contact::updateFromProbe($contact['id']); + Logger::debug('Direct update', ['id' => $contact['id'], 'count' => $count, 'duration' => round((float)microtime(true) - $stamp, 3), 'success' => $success]); + ++$count; + } elseif (UpdateContact::add(['priority' => Worker::PRIORITY_LOW, 'dont_fork' => true], $contact['id'])) { + Logger::debug('Update by worker', ['id' => $contact['id'], 'count' => $count]); + ++$count; + } + } catch (\InvalidArgumentException $e) { + Logger::notice($e->getMessage(), ['contact' => $contact]); } + Worker::coolDown(); } DBA::close($contacts);