summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-04-20 13:25:49 +0200
committerRobin Appelman <robin@icewind.nl>2017-04-20 13:25:49 +0200
commita0e5107c0b01d6ade0fe28f248c418ab5fd95d62 (patch)
treeffba6293fef6c101d0cdf39c85da5e57e42765cd /lib
parentfbedea08076355f9c94b7aa4d14f6157749a4fe7 (diff)
downloadnextcloud-server-a0e5107c0b01d6ade0fe28f248c418ab5fd95d62.tar.gz
nextcloud-server-a0e5107c0b01d6ade0fe28f248c418ab5fd95d62.zip
check for existence before we start the db transaction
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Utils/Scanner.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php
index 5d126f2bcc3..02f355fd4d9 100644
--- a/lib/private/Files/Utils/Scanner.php
+++ b/lib/private/Files/Utils/Scanner.php
@@ -212,15 +212,15 @@ class Scanner extends PublicEmitter {
$this->triggerPropagator($storage, $path);
});
+ if (!$storage->file_exists($relativePath)) {
+ throw new NotFoundException($dir);
+ }
if (!$isDbLocking) {
$this->db->beginTransaction();
}
try {
$propagator = $storage->getPropagator();
$propagator->beginBatch();
- if (!$storage->file_exists($relativePath)) {
- throw new NotFoundException($dir);
- }
$scanner->scan($relativePath, \OC\Files\Cache\Scanner::SCAN_RECURSIVE, \OC\Files\Cache\Scanner::REUSE_ETAG | \OC\Files\Cache\Scanner::REUSE_SIZE);
$cache = $storage->getCache();
if ($cache instanceof Cache) {