aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2020-07-07 15:55:38 +0200
committerRobin Appelman <robin@icewind.nl>2020-07-07 15:55:38 +0200
commit0d6910ac13a52f8bfff51056633ea91848f46752 (patch)
tree5684f172d6f9dded1ca9d1c01cf492e725261df8 /apps/files_external/lib/Lib
parentcd7a6276f27e641cfa8f835c53cd3781e69d1d67 (diff)
downloadnextcloud-server-0d6910ac13a52f8bfff51056633ea91848f46752.tar.gz
nextcloud-server-0d6910ac13a52f8bfff51056633ea91848f46752.zip
disable touch to update mtime for external s3 storage
since updating the mtime requires doing a copy this can have a significant overhead and it messes with versioning Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external/lib/Lib')
-rw-r--r--apps/files_external/lib/Lib/Storage/AmazonS3.php18
1 files changed, 1 insertions, 17 deletions
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php
index 641a26b20ee..79b48ef453b 100644
--- a/apps/files_external/lib/Lib/Storage/AmazonS3.php
+++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php
@@ -544,9 +544,6 @@ class AmazonS3 extends \OC\Files\Storage\Common {
}
public function touch($path, $mtime = null) {
- $path = $this->normalizePath($path);
-
- $metadata = [];
if (is_null($mtime)) {
$mtime = time();
}
@@ -554,21 +551,8 @@ class AmazonS3 extends \OC\Files\Storage\Common {
'lastmodified' => gmdate(\DateTime::RFC1123, $mtime)
];
- $fileType = $this->filetype($path);
try {
- if ($fileType !== false) {
- if ($fileType === 'dir' && !$this->isRoot($path)) {
- $path .= '/';
- }
- $this->getConnection()->copyObject([
- 'Bucket' => $this->bucket,
- 'Key' => $this->cleanKey($path),
- 'Metadata' => $metadata,
- 'CopySource' => $this->bucket . '/' . $path,
- 'MetadataDirective' => 'REPLACE',
- ]);
- $this->testTimeout();
- } else {
+ if (!$this->file_exists($path)) {
$mimeType = \OC::$server->getMimeTypeDetector()->detectPath($path);
$this->getConnection()->putObject([
'Bucket' => $this->bucket,