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>
This commit is contained in:
parent
cd7a6276f2
commit
0d6910ac13
|
@ -544,9 +544,6 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function touch($path, $mtime = null) {
|
public function touch($path, $mtime = null) {
|
||||||
$path = $this->normalizePath($path);
|
|
||||||
|
|
||||||
$metadata = [];
|
|
||||||
if (is_null($mtime)) {
|
if (is_null($mtime)) {
|
||||||
$mtime = time();
|
$mtime = time();
|
||||||
}
|
}
|
||||||
|
@ -554,21 +551,8 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
||||||
'lastmodified' => gmdate(\DateTime::RFC1123, $mtime)
|
'lastmodified' => gmdate(\DateTime::RFC1123, $mtime)
|
||||||
];
|
];
|
||||||
|
|
||||||
$fileType = $this->filetype($path);
|
|
||||||
try {
|
try {
|
||||||
if ($fileType !== false) {
|
if (!$this->file_exists($path)) {
|
||||||
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 {
|
|
||||||
$mimeType = \OC::$server->getMimeTypeDetector()->detectPath($path);
|
$mimeType = \OC::$server->getMimeTypeDetector()->detectPath($path);
|
||||||
$this->getConnection()->putObject([
|
$this->getConnection()->putObject([
|
||||||
'Bucket' => $this->bucket,
|
'Bucket' => $this->bucket,
|
||||||
|
|
Loading…
Reference in New Issue