diff options
-rw-r--r-- | apps/files_trashbin/lib/Trashbin.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index bf396d40abf..eb1a6f704fd 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -790,8 +790,15 @@ 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()->warning( + 'Removing "' . $filename . '" from trashbin failed (OCP\\Files\\NotPermittedException).', + ['app' => 'files_trashbin'] + ); + } \OC::$server->getLogger()->info( 'Remove "' . $filename . '" from trashbin because it exceeds max retention obligation term.', ['app' => 'files_trashbin'] |