mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
dont do optimized size propagation for encrypted files
This commit is contained in:
parent
b7867e9368
commit
5762a68c97
2 changed files with 11 additions and 1 deletions
7
lib/private/files/cache/scanner.php
vendored
7
lib/private/files/cache/scanner.php
vendored
|
|
@ -205,6 +205,10 @@ class Scanner extends BasicEmitter implements IScanner {
|
|||
$data['oldSize'] = 0;
|
||||
}
|
||||
|
||||
if (isset($cacheData['encrypted'])) {
|
||||
$data['encrypted'] = $cacheData['encrypted'];
|
||||
}
|
||||
|
||||
// post-emit only if it was a file. By that we avoid counting/treating folders as files
|
||||
if ($data['mimetype'] !== 'httpd/unix-directory') {
|
||||
$this->emit('\OC\Files\Cache\Scanner', 'postScanFile', array($file, $this->storageId));
|
||||
|
|
@ -222,6 +226,9 @@ class Scanner extends BasicEmitter implements IScanner {
|
|||
}
|
||||
}
|
||||
|
||||
if ($data && !isset($data['encrypted'])) {
|
||||
$data['encrypted'] = false;
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
|
|
|||
5
lib/private/files/cache/updater.php
vendored
5
lib/private/files/cache/updater.php
vendored
|
|
@ -118,7 +118,10 @@ class Updater implements IUpdater {
|
|||
}
|
||||
|
||||
$data = $this->scanner->scan($path, Scanner::SCAN_SHALLOW, -1, false);
|
||||
if (isset($data['oldSize']) && isset($data['size'])) {
|
||||
if (
|
||||
isset($data['oldSize']) && isset($data['size']) &&
|
||||
!$data['encrypted'] // encryption is a pita and touches the cache itself
|
||||
) {
|
||||
$sizeDifference = $data['size'] - $data['oldSize'];
|
||||
} else {
|
||||
// scanner didn't provide size info, fallback to full size calculation
|
||||
|
|
|
|||
Loading…
Reference in a new issue