mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
feat(objectstore): add configurable S3 retry attempts
Add retriesMaxAttempts parameter to S3 objectstore configuration to allow customization of AWS SDK retry behavior for handling unreliable network conditions or proxy issues. Defaults to 5 retries (AWS SDK default) if not specified. Signed-off-by: nfebe <fenn25.fn@gmail.com> Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
parent
adfbefb8b7
commit
8d5dcbce79
3 changed files with 23 additions and 1 deletions
|
|
@ -1818,6 +1818,25 @@ $CONFIG = [
|
|||
],
|
||||
],
|
||||
|
||||
/**
|
||||
* To use S3 object storage
|
||||
*/
|
||||
'objectstore' => [
|
||||
'class' => 'OC\\Files\\ObjectStore\\S3',
|
||||
'arguments' => [
|
||||
'bucket' => 'nextcloud',
|
||||
'key' => 'your-access-key',
|
||||
'secret' => 'your-secret-key',
|
||||
'hostname' => 's3.example.com',
|
||||
'port' => 443,
|
||||
'use_ssl' => true,
|
||||
'region' => 'us-east-1',
|
||||
// optional: Maximum number of retry attempts for failed S3 requests
|
||||
// Default: 5
|
||||
'retriesMaxAttempts' => 5,
|
||||
],
|
||||
],
|
||||
|
||||
/**
|
||||
* If this is set to true and a multibucket object store is configured then
|
||||
* newly created previews are put into 256 dedicated buckets.
|
||||
|
|
|
|||
|
|
@ -38,4 +38,6 @@ trait S3ConfigTrait {
|
|||
private int|float $copySizeLimit;
|
||||
|
||||
private bool $useMultipartCopy = true;
|
||||
|
||||
protected int $retriesMaxAttempts;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ trait S3ConnectionTrait {
|
|||
$this->putSizeLimit = $params['putSizeLimit'] ?? 104857600;
|
||||
$this->copySizeLimit = $params['copySizeLimit'] ?? 5242880000;
|
||||
$this->useMultipartCopy = (bool)($params['useMultipartCopy'] ?? true);
|
||||
$this->retriesMaxAttempts = $params['retriesMaxAttempts'] ?? 5;
|
||||
$params['region'] = empty($params['region']) ? 'eu-west-1' : $params['region'];
|
||||
$params['hostname'] = empty($params['hostname']) ? 's3.' . $params['region'] . '.amazonaws.com' : $params['hostname'];
|
||||
$params['s3-accelerate'] = $params['hostname'] === 's3-accelerate.amazonaws.com' || $params['hostname'] === 's3-accelerate.dualstack.amazonaws.com';
|
||||
|
|
@ -114,7 +115,7 @@ trait S3ConnectionTrait {
|
|||
'use_aws_shared_config_files' => false,
|
||||
'retries' => [
|
||||
'mode' => 'standard',
|
||||
'max_attempts' => 5,
|
||||
'max_attempts' => $this->retriesMaxAttempts,
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue