Skip to content

Commit ae5febb

Browse files
Merge pull request #53532 from nextcloud/backport/53498/stable31
[stable31] fix(ObjectStore): Make S3 "connect_timeout" option configurable
2 parents 6aae30c + 019b535 commit ae5febb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/private/Files/ObjectStore/S3ConfigTrait.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ trait S3ConfigTrait {
1818
/** Maximum number of concurrent multipart uploads */
1919
protected int $concurrency;
2020

21+
/** Timeout, in seconds, for the connection to S3 server, not for the
22+
* request. */
23+
protected float $connectTimeout;
24+
2125
protected int $timeout;
2226

2327
protected string|false $proxy;

lib/private/Files/ObjectStore/S3ConnectionTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ protected function parseParams($params) {
3939
// Default to 5 like the S3 SDK does
4040
$this->concurrency = $params['concurrency'] ?? 5;
4141
$this->proxy = $params['proxy'] ?? false;
42+
$this->connectTimeout = $params['connect_timeout'] ?? 5;
4243
$this->timeout = $params['timeout'] ?? 15;
4344
$this->storageClass = !empty($params['storageClass']) ? $params['storageClass'] : 'STANDARD';
4445
$this->uploadPartSize = $params['uploadPartSize'] ?? 524288000;
@@ -102,8 +103,7 @@ public function getConnection() {
102103
'use_arn_region' => false,
103104
'http' => [
104105
'verify' => $this->getCertificateBundlePath(),
105-
// Timeout for the connection to S3 server, not for the request.
106-
'connect_timeout' => 5
106+
'connect_timeout' => $this->connectTimeout,
107107
],
108108
'use_aws_shared_config_files' => false,
109109
'retries' => [

0 commit comments

Comments
 (0)