Skip to content

Commit 42e16a9

Browse files
Merge pull request #53531 from nextcloud/backport/53498/stable30
[stable30] fix(ObjectStore): Make S3 "connect_timeout" option configurable
2 parents 94cc856 + 5830546 commit 42e16a9

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
@@ -40,6 +40,7 @@ protected function parseParams($params) {
4040
// Default to 5 like the S3 SDK does
4141
$this->concurrency = $params['concurrency'] ?? 5;
4242
$this->proxy = $params['proxy'] ?? false;
43+
$this->connectTimeout = $params['connect_timeout'] ?? 5;
4344
$this->timeout = $params['timeout'] ?? 15;
4445
$this->storageClass = !empty($params['storageClass']) ? $params['storageClass'] : 'STANDARD';
4546
$this->uploadPartSize = $params['uploadPartSize'] ?? 524288000;
@@ -103,8 +104,7 @@ public function getConnection() {
103104
'use_arn_region' => false,
104105
'http' => [
105106
'verify' => $this->getCertificateBundlePath(),
106-
// Timeout for the connection to S3 server, not for the request.
107-
'connect_timeout' => 5
107+
'connect_timeout' => $this->connectTimeout,
108108
],
109109
'use_aws_shared_config_files' => false,
110110
'retries' => [

0 commit comments

Comments
 (0)