Rollback folder scan if an entry was locked

This commit is contained in:
Vincent Petry 2015-06-24 15:42:00 +02:00
parent 35047a2300
commit 8859004a2b

View file

@ -357,6 +357,11 @@ class Scanner extends BasicEmitter {
// log and ignore
\OC_Log::write('core', 'Exception while scanning file "' . $child . '": ' . $ex->getMessage(), \OC_Log::DEBUG);
$exceptionOccurred = true;
} catch (\OCP\Lock\LockedException $e) {
if ($this->useTransactions) {
\OC_DB::rollback();
}
throw $e;
}
}
$removedChildren = \array_diff(array_keys($existingChildren), $newChildren);