diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2020-11-06 11:06:40 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-11-06 11:08:38 +0100 |
commit | 65141d4864d200d01e9fcd7cfea6e2e8cc4b3521 (patch) | |
tree | 20bc73d5d5ec7b38d68a5f84cc74e4fec1ce3a68 /lib | |
parent | 2c6bbe783a6ab0f75f9ad85d66d9b4511a7543be (diff) | |
download | nextcloud-server-65141d4864d200d01e9fcd7cfea6e2e8cc4b3521.tar.gz nextcloud-server-65141d4864d200d01e9fcd7cfea6e2e8cc4b3521.zip |
Allow config to specify the bucket exists
In the 99% case the bucket is just always there. And if it is not the
read/write will fail hard anyways. Esp on big instances the Objectstore
is not always fast and this can save a few hundered ms of each request
that acess the objectstore.
In short it is adding
'verify_bucket_exists' => false
To the S3 config part
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/ObjectStore/S3ConnectionTrait.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php index 467ae81c8a4..c98c8a04cdf 100644 --- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php +++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php @@ -76,6 +76,7 @@ trait S3ConnectionTrait { if (!isset($params['port']) || $params['port'] === '') { $params['port'] = (isset($params['use_ssl']) && $params['use_ssl'] === false) ? 80 : 443; } + $params['verify_bucket_exists'] = empty($params['verify_bucket_exists']) ? true : $params['verify_bucket_exists']; $this->params = $params; } @@ -130,7 +131,7 @@ trait S3ConnectionTrait { ['app' => 'objectstore']); } - if (!$this->connection->doesBucketExist($this->bucket)) { + if ($this->params['verify_bucket_exists'] && !$this->connection->doesBucketExist($this->bucket)) { $logger = \OC::$server->getLogger(); try { $logger->info('Bucket "' . $this->bucket . '" does not exist - creating it.', ['app' => 'objectstore']); |