Skip to content

Commit

Permalink
Merge pull request #23932 from nextcloud/enh/s3/do_not_check_bucket_e…
Browse files Browse the repository at this point in the history
…xists_on_every_request

Allow config to specify the bucket exists
  • Loading branch information
MorrisJobke authored Nov 6, 2020
2 parents 3f4fb9d + 65141d4 commit 9e2ced6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/private/Files/ObjectStore/S3ConnectionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ protected function parseParams($params) {
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;
}

Expand Down Expand Up @@ -130,7 +131,7 @@ public function getConnection() {
['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']);
Expand Down

0 comments on commit 9e2ced6

Please sign in to comment.