summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/hooks
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-06-11 12:03:50 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-06-11 12:03:50 +0200
commit5fafd55108d1ecd13befaa589902a84a23276af8 (patch)
treef7b99b7189b952cff032eee9dc0faa468b4cb271 /apps/files_encryption/hooks
parent4f0f537b422015fb5573d3b50c3d0a7137a1384d (diff)
downloadnextcloud-server-5fafd55108d1ecd13befaa589902a84a23276af8.tar.gz
nextcloud-server-5fafd55108d1ecd13befaa589902a84a23276af8.zip
make sure that only one process can enter the migration mode
Diffstat (limited to 'apps/files_encryption/hooks')
-rw-r--r--apps/files_encryption/hooks/hooks.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index c4b247da1ed..9f36393d591 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -67,10 +67,10 @@ class Hooks {
$session->setPrivateKey($privateKey, $params['uid']);
// Check if first-run file migration has already been performed
- $migrationCompleted = $util->getMigrationStatus();
+ $ready = $util->beginMigration();
// If migration not yet done
- if (!$migrationCompleted) {
+ if ($ready) {
$userView = new \OC_FilesystemView('/' . $params['uid']);
@@ -102,7 +102,7 @@ class Hooks {
}
// Register successful migration in DB
- $util->setMigrationStatus(1);
+ $util->finishMigration();
}