check for existence before we start the db transaction

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2017-04-20 13:25:49 +02:00
parent fbedea0807
commit a0e5107c0b
No known key found for this signature in database
GPG Key ID: CBCA68FBAEBF98C9
1 changed files with 3 additions and 3 deletions

View File

@ -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) {