From 85f029a7244b4ecea37c94a8fb99eb7878224286 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 6 Feb 2022 09:03:48 +0000 Subject: [PATCH] Enforce probing --- src/Model/GServer.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Model/GServer.php b/src/Model/GServer.php index 6a4b14a7b6..d38078ea54 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -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; } } -- 2.39.5