From c7e31eb87b715a4d451bbcc8cb51199a326b6940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Wed, 6 Sep 2017 09:51:47 +0200 Subject: [PATCH] clear filecache cache manually --- lib/Migration.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Migration.php b/lib/Migration.php index 59c872ba..529db34d 100644 --- a/lib/Migration.php +++ b/lib/Migration.php @@ -25,6 +25,7 @@ namespace OCA\Encryption; +use OC\Files\Cache\Cache; use OC\Files\View; use OCP\IConfig; use OCP\IDBConnection; @@ -67,6 +68,7 @@ public function finalCleanUp() { } /** + * FIXME don't run our own sql here, use the filecache * update file cache, copy unencrypted_size to the 'size' column */ private function updateFileCache() { @@ -79,6 +81,7 @@ private function updateFileCache() { ->where($query->expr()->eq('encrypted', $query->createParameter('encrypted'))) ->setParameter('encrypted', 1); $query->execute(); + Cache::$metaDataCache->clear(); } } @@ -91,7 +94,7 @@ public function reorganizeFolderStructure() { $limit = 500; $offset = 0; do { - $users = \OC::$server->getUserManager()->search('', $limit, $offset); + $users = \OC::$server->getUserManager()->search('', $limit, $offset); foreach ($users as $user) { $this->reorganizeFolderStructureForUser($user->getUID()); } @@ -349,7 +352,7 @@ private function getTargetDir($user, $keyPath, $filename, $trash) { foreach ($systemMountPoints as $mountPoint) { $normalizedMountPoint = \OC\Files\Filesystem::normalizePath($mountPoint['mountpoint']) . '/'; if (strpos($normalized, $normalizedMountPoint) === 0) { - return $targetDir; + return $targetDir; } } } else if ($trash === false && $this->view->file_exists('/' . $user . '/files/' . $filePath)) {