]> git.mxchange.org Git - friendica.git/commitdiff
Enforce probing
authorMichael <heluecht@pirati.ca>
Sun, 6 Feb 2022 09:03:48 +0000 (09:03 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 6 Feb 2022 09:03:48 +0000 (09:03 +0000)
src/Model/GServer.php

index 6a4b14a7b6a6d6e4091a14c9f98fc8ed5623b9dd..d38078ea5485a9010062039a17bd2d265072b4fd 100644 (file)
@@ -1050,11 +1050,15 @@ class GServer
                        return $serverdata;
                }
 
+               $retrial = 0;
                foreach ($contacts as $contact) {
-                       $probed = Contact::getByURL($contact);
+                       $probed = Contact::getByURL($contact, true);
                        if (!empty($probed) && !$probed['failed'] && in_array($probed['network'], Protocol::FEDERATED)) {
                                $serverdata['network'] = $probed['network'];
                                break;
+                       } elseif (++$retrial > 10) {
+                               // To reduce the stress on remote systems we probe a maximum of 10 contacts
+                               break;
                        }
                }