File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
lib/private/Files/ObjectStore Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 19641964 ],
19651965 ],
19661966
1967+ /**
1968+ * To use S3 object storage
1969+ */
1970+ 'objectstore ' => [
1971+ 'class ' => 'OC \\Files \\ObjectStore \\S3 ' ,
1972+ 'arguments ' => [
1973+ 'bucket ' => 'nextcloud ' ,
1974+ 'key ' => 'your-access-key ' ,
1975+ 'secret ' => 'your-secret-key ' ,
1976+ 'hostname ' => 's3.example.com ' ,
1977+ 'port ' => 443 ,
1978+ 'use_ssl ' => true ,
1979+ 'region ' => 'us-east-1 ' ,
1980+ // optional: Maximum number of retry attempts for failed S3 requests
1981+ // Default: 5
1982+ 'retriesMaxAttempts ' => 5 ,
1983+ ],
1984+ ],
1985+
19671986 /**
19681987 * If this is set to true and a multibucket object store is configured, then
19691988 * newly created previews are put into 256 dedicated buckets.
Original file line number Diff line number Diff line change @@ -38,4 +38,6 @@ trait S3ConfigTrait {
3838 private int |float $ copySizeLimit ;
3939
4040 private bool $ useMultipartCopy = true ;
41+
42+ protected int $ retriesMaxAttempts ;
4143}
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ protected function parseParams($params) {
4747 $ this ->putSizeLimit = $ params ['putSizeLimit ' ] ?? 104857600 ;
4848 $ this ->copySizeLimit = $ params ['copySizeLimit ' ] ?? 5242880000 ;
4949 $ this ->useMultipartCopy = (bool )($ params ['useMultipartCopy ' ] ?? true );
50+ $ this ->retriesMaxAttempts = $ params ['retriesMaxAttempts ' ] ?? 5 ;
5051 $ params ['region ' ] = empty ($ params ['region ' ]) ? 'eu-west-1 ' : $ params ['region ' ];
5152 $ params ['hostname ' ] = empty ($ params ['hostname ' ]) ? 's3. ' . $ params ['region ' ] . '.amazonaws.com ' : $ params ['hostname ' ];
5253 $ params ['s3-accelerate ' ] = $ params ['hostname ' ] === 's3-accelerate.amazonaws.com ' || $ params ['hostname ' ] === 's3-accelerate.dualstack.amazonaws.com ' ;
@@ -109,7 +110,7 @@ public function getConnection() {
109110 'use_aws_shared_config_files ' => false ,
110111 'retries ' => [
111112 'mode ' => 'standard ' ,
112- 'max_attempts ' => 5 ,
113+ 'max_attempts ' => $ this -> retriesMaxAttempts ,
113114 ],
114115 ];
115116
You can’t perform that action at this time.
0 commit comments