From 12e866621dfbfe96c4c1001ae0296bf70507ac38 Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Wed, 25 Oct 2023 14:09:14 -0400 Subject: [PATCH] set extension browser timeout to minimum of 10 seconds. --- CRM/Extension/Browser.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/CRM/Extension/Browser.php b/CRM/Extension/Browser.php index 5b7b683fd7..cf6dcae9d3 100644 --- a/CRM/Extension/Browser.php +++ b/CRM/Extension/Browser.php @@ -34,11 +34,6 @@ class CRM_Extension_Browser { */ const SINGLE_FILE_PATH = '/single'; - /** - * Timeout for when the connection or the server is slow - */ - const CHECK_TIMEOUT = 5; - /** * @var GuzzleHttp\Client */ @@ -219,9 +214,11 @@ class CRM_Extension_Browser { $url = $this->getRepositoryUrl() . $this->indexPath; $client = $this->getGuzzleClient(); + // Timeout should be a minimum of 10 seconds. See https://lab.civicrm.org/infra/ops/-/issues/1009. + $timeout = max(10, \Civi::settings()->get('http_timeout')); try { $response = $client->request('GET', $url, [ - 'timeout' => \Civi::settings()->get('http_timeout'), + 'timeout' => $timeout, ]); } catch (GuzzleException $e) { -- 2.25.1