Workaround for interrupting expired files deletion
Workaround avoiding "Error while running background job (class: OCA\Files_Trashbin\BackgroundJob\ExpireTrash, arguments: ): {"Exception":"OCP\\Files\\NotPermittedException","Message":"","Code":0,"Trace":"#0 \/var\/www\/cloud\/apps\/files_trashbin\/lib\/Trashbin.php(590): OC\\Files\\Node\\File->delete() [...]"
This commit is contained in:
parent
9e00b51c87
commit
e360885eb0
|
@ -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']
|
||||
|
|
Loading…
Reference in New Issue