diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-03-11 00:54:20 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-03-11 00:54:20 +0100 |
commit | 1757d01604c311f9494a61f9bed87c3fae8c6fe9 (patch) | |
tree | aa1fdba2f3950212b0e82aa6c6e4d268aaa9be7e | |
parent | 9a9633f84f65d461054526a1bebc41e32cf602aa (diff) | |
parent | 7432c73f5c2871a708dd8c51487197f12eb2458a (diff) | |
download | nextcloud-server-1757d01604c311f9494a61f9bed87c3fae8c6fe9.tar.gz nextcloud-server-1757d01604c311f9494a61f9bed87c3fae8c6fe9.zip |
Merge pull request #14640 from owncloud/rescanversionsonlyonce
Only rescan versions once in trashbin
-rw-r--r-- | apps/files_trashbin/lib/trashbin.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php index 8ce6d668d66..f30d61542fa 100644 --- a/apps/files_trashbin/lib/trashbin.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -32,6 +32,13 @@ class Trashbin { // unit: percentage; 50% of available disk space/quota const DEFAULTMAXSIZE = 50; + /** + * Whether versions have already be rescanned during this PHP request + * + * @var bool + */ + private static $scannedVersions = false; + public static function getUidAndFilename($filename) { $uid = \OC\Files\Filesystem::getOwner($filename); \OC\Files\Filesystem::initMountPoints($uid); @@ -825,9 +832,12 @@ class Trashbin { $versions = array(); //force rescan of versions, local storage may not have updated the cache - /** @var \OC\Files\Storage\Storage $storage */ - list($storage, ) = $view->resolvePath('/'); - $storage->getScanner()->scan('files_trashbin'); + if (!self::$scannedVersions) { + /** @var \OC\Files\Storage\Storage $storage */ + list($storage, ) = $view->resolvePath('/'); + $storage->getScanner()->scan('files_trashbin/versions'); + self::$scannedVersions = true; + } if ($timestamp) { // fetch for old versions |