Merge pull request #9626 from lars-sh/patch-1

Workaround for interrupting expired files deletion
This commit is contained in:
Morris Jobke 2018-06-25 16:44:55 +02:00 committed by GitHub
commit ab266a7798
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -790,8 +790,12 @@ class Trashbin {
$timestamp = $file['mtime'];
$filename = $file['name'];
if ($expiration->isExpired($timestamp)) {
$count++;
$size += self::delete($filename, $user, $timestamp);
try {
$size += self::delete($filename, $user, $timestamp);
$count++;
} catch (\OCP\Files\NotPermittedException $e) {
\OC::$server->getLogger()->logException($e, ['app' => 'files_trashbin', 'level' => \OCP\ILogger::WARN, 'message' => 'Removing "' . $filename . '" from trashbin failed.']);
}
\OC::$server->getLogger()->info(
'Remove "' . $filename . '" from trashbin because it exceeds max retention obligation term.',
['app' => 'files_trashbin']