Delete files that exceed trashbin size immediately
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
22f5093f7b
commit
1a607b2030
|
@ -287,6 +287,14 @@ class Trashbin {
|
||||||
$trashStorage->unlink($trashInternalPath);
|
$trashStorage->unlink($trashInternalPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$config = \OC::$server->getConfig();
|
||||||
|
$systemTrashbinSize = (int)$config->getAppValue('files_trashbin', 'trashbin_size', '-1');
|
||||||
|
$userTrashbinSize = (int)$config->getUserValue($owner, 'files_trashbin', 'trashbin_size', '-1');
|
||||||
|
$configuredTrashbinSize = ($userTrashbinSize < 0) ? $systemTrashbinSize : $userTrashbinSize;
|
||||||
|
if ($configuredTrashbinSize >= 0 && $sourceStorage->filesize($sourceInternalPath) >= $configuredTrashbinSize) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$trashStorage->getUpdater()->renameFromStorage($sourceStorage, $sourceInternalPath, $trashInternalPath);
|
$trashStorage->getUpdater()->renameFromStorage($sourceStorage, $sourceInternalPath, $trashInternalPath);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue