mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
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>
This commit is contained in:
parent
2c6bbe783a
commit
65141d4864
1 changed files with 2 additions and 1 deletions
|
|
@ -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']);
|
||||
|
|
|
|||
Loading…
Reference in a new issue