summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-06-25 16:44:55 +0200
committerGitHub <noreply@github.com>2018-06-25 16:44:55 +0200
commitab266a7798b1a423f92fba74fa9003ccbe2554da (patch)
tree840bfbb5e4aed9e242abce3302150113fe78ffec /apps
parent9444a3fad1b6238a431b264f162239a777fd9591 (diff)
parent436c4f895480b73190861e98669301ebd95cdc8c (diff)
downloadnextcloud-server-ab266a7798b1a423f92fba74fa9003ccbe2554da.tar.gz
nextcloud-server-ab266a7798b1a423f92fba74fa9003ccbe2554da.zip
Merge pull request #9626 from lars-sh/patch-1
Workaround for interrupting expired files deletion
Diffstat (limited to 'apps')
-rw-r--r--apps/files_trashbin/lib/Trashbin.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php
index bf396d40abf..b9a8a42a21c 100644
--- a/apps/files_trashbin/lib/Trashbin.php
+++ b/apps/files_trashbin/lib/Trashbin.php
@@ -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']