mirror of
https://github.com/friendica/friendica
synced 2024-11-09 23:42:53 +00:00
Set the timeout to 10 seconds
This commit is contained in:
parent
b3da88ceaa
commit
8b585c6ccc
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue