Merge pull request #16564 from nextcloud/backport/16557/stable16

[stable16] Do not log locked files
This commit is contained in:
Roeland Jago Douma 2019-07-27 10:38:25 +02:00 committed by GitHub
commit d092802a2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -55,6 +55,7 @@ use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
use OCP\Files\Storage;
use OCP\Files\StorageNotAvailableException;
use OCP\ILogger;
use OCP\Lock\ILockingProvider;
use OCP\Lock\LockedException;
use OCP\Share\IManager;
@ -229,7 +230,13 @@ class File extends Node implements IFile {
}
} catch (\Exception $e) {
\OC::$server->getLogger()->logException($e);
$context = [];
if ($e instanceof LockedException) {
$context['level'] = ILogger::DEBUG;
}
\OC::$server->getLogger()->logException($e, $context);
if ($needsPartFile) {
$partStorage->unlink($internalPartPath);
}