From 8b585c6cccd84eecef44778a67d9183be4c3bf0f Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 6 Feb 2022 10:07:18 +0000 Subject: [PATCH] Set the timeout to 10 seconds --- src/Model/GServer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Model/GServer.php b/src/Model/GServer.php index 3b4866cbf2..90b023f6fd 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -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; } } -- 2.39.5