]> git.mxchange.org Git - friendica.git/commitdiff
Set the timeout to 10 seconds
authorMichael <heluecht@pirati.ca>
Sun, 6 Feb 2022 10:07:18 +0000 (10:07 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 6 Feb 2022 10:07:18 +0000 (10:07 +0000)
src/Model/GServer.php

index 3b4866cbf24baaee98c4f1eab442ce7e6441c01a..90b023f6fd3f50a0f0e8d9a661a4b6f4fd1b3570 100644 (file)
@@ -1050,14 +1050,14 @@ class GServer
                        return $serverdata;
                }
 
-               $retrial = 0;
+               $time = time();
                foreach ($contacts as $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
+                       } elseif ((time() - $time) > 10) {
+                               // To reduce the stress on remote systems we probe a maximum of 10 seconds
                                break;
                        }
                }