summaryrefslogtreecommitdiffstats
path: root/lib/private/Encryption
diff options
context:
space:
mode:
authorChristian Jürges <christian@eqipe.ch>2016-03-08 16:24:27 +0100
committerVincent Petry <pvince81@owncloud.com>2016-05-30 14:49:27 +0200
commitb996c1f43f2e75bbb3aed7b0832ac25db30ba258 (patch)
tree307c8734f5b05f8ed70c8ca447b2a3db33f7ce11 /lib/private/Encryption
parent0e3a0e0fdb17938d473434d94e3c16c1c5dccf73 (diff)
downloadnextcloud-server-b996c1f43f2e75bbb3aed7b0832ac25db30ba258.tar.gz
nextcloud-server-b996c1f43f2e75bbb3aed7b0832ac25db30ba258.zip
Check if file needs to decrypted or not for speed up large oc setups.
Diffstat (limited to 'lib/private/Encryption')
-rw-r--r--lib/private/Encryption/DecryptAll.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/Encryption/DecryptAll.php b/lib/private/Encryption/DecryptAll.php
index 973036fe14d..303e7776a61 100644
--- a/lib/private/Encryption/DecryptAll.php
+++ b/lib/private/Encryption/DecryptAll.php
@@ -133,6 +133,7 @@ class DecryptAll {
/**
* iterate over all user and encrypt their files
+ *
* @param string $user which users files should be decrypted, default = all users
*/
protected function decryptAllUsersFiles($user = '') {
@@ -200,9 +201,9 @@ class DecryptAll {
$this->setupUserFS($uid);
$directories = array();
- $directories[] = '/' . $uid . '/files';
+ $directories[] = '/' . $uid . '/files';
- while($root = array_pop($directories)) {
+ while ($root = array_pop($directories)) {
$content = $this->rootView->getDirectoryContent($root);
foreach ($content as $file) {
$path = $root . '/' . $file['name'];
@@ -213,9 +214,14 @@ class DecryptAll {
try {
$progress->setMessage("decrypt files for user $userCount: $path");
$progress->advance();
- if ($this->decryptFile($path) === false) {
+ if ($file->getData()['encrypted'] == 0) {
$progress->setMessage("decrypt files for user $userCount: $path (already decrypted)");
$progress->advance();
+ } else {
+ if ($this->decryptFile($path) === false) {
+ $progress->setMessage("decrypt files for user $userCount: $path (already decrypted)");
+ $progress->advance();
+ }
}
} catch (\Exception $e) {
if (isset($this->failed[$uid])) {