mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Manage s3 storage class in objectstore
Signed-off-by: François Ménabé <francois.menabe@gmail.com>
This commit is contained in:
parent
fc096ae9db
commit
cf9bdc0274
2 changed files with 7 additions and 1 deletions
|
|
@ -62,6 +62,9 @@ trait S3ConnectionTrait {
|
|||
/** @var string */
|
||||
protected $proxy;
|
||||
|
||||
/** @var string */
|
||||
protected $storageClass;
|
||||
|
||||
/** @var int */
|
||||
protected $uploadPartSize;
|
||||
|
||||
|
|
@ -81,6 +84,7 @@ trait S3ConnectionTrait {
|
|||
$this->bucket = $params['bucket'];
|
||||
$this->proxy = $params['proxy'] ?? false;
|
||||
$this->timeout = $params['timeout'] ?? 15;
|
||||
$this->storageClass = !empty($params['storageClass']) ? $params['storageClass'] : 'STANDARD';
|
||||
$this->uploadPartSize = $params['uploadPartSize'] ?? 524288000;
|
||||
$this->putSizeLimit = $params['putSizeLimit'] ?? 104857600;
|
||||
$params['region'] = empty($params['region']) ? 'eu-west-1' : $params['region'];
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ trait S3ObjectTrait {
|
|||
'Body' => $stream,
|
||||
'ACL' => 'private',
|
||||
'ContentType' => $mimetype,
|
||||
'StorageClass' => $this->storageClass,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -123,7 +124,8 @@ trait S3ObjectTrait {
|
|||
'key' => $urn,
|
||||
'part_size' => $this->uploadPartSize,
|
||||
'params' => [
|
||||
'ContentType' => $mimetype
|
||||
'ContentType' => $mimetype,
|
||||
'StorageClass' => $this->storageClass,
|
||||
],
|
||||
]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue