Skip to content

Commit b7150ad

Browse files
hweihwangicewind1991
authored andcommitted
perf(trashbin): avoid full rescan for uncached moves
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
1 parent eedd8dc commit b7150ad

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

apps/files_trashbin/lib/Trashbin.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,11 @@ public static function move2trash($file_path, $ownerOnly = false) {
358358
if ($inCache) {
359359
$trashStorage->getUpdater()->renameFromStorage($sourceStorage, $sourceInternalPath, $trashInternalPath);
360360
} else {
361-
$trashStorage->getUpdater()->update($trashInternalPath);
361+
$sizeDifference = $sourceInfo->getSize();
362+
if ($sizeDifference < 0) {
363+
$sizeDifference = null;
364+
}
365+
$trashStorage->getUpdater()->update($trashInternalPath, null, $sizeDifference);
362366
}
363367
} catch (CopyRecursiveException $e) {
364368
$moveSuccessful = false;

0 commit comments

Comments
 (0)