summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2023-02-01 16:43:05 +0100
committerJulius Härtl <jus@bitgrid.net>2023-02-02 17:23:05 +0100
commit7f913dec032f0f8ff83eb7c9038ac0bc40bc6d87 (patch)
tree911ff846c605bae91157bfe9d662505e4d6d21f6 /apps/files_trashbin
parentd92538850f9d031d7e1d80479e259050f86d73ae (diff)
downloadnextcloud-server-7f913dec032f0f8ff83eb7c9038ac0bc40bc6d87.tar.gz
nextcloud-server-7f913dec032f0f8ff83eb7c9038ac0bc40bc6d87.zip
fix(files_trashbin): Remove unnecessary scanner logic when getting versions from trash
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/lib/Trashbin.php24
1 files changed, 0 insertions, 24 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php
index 46a2b07fc07..00e6b35cc62 100644
--- a/apps/files_trashbin/lib/Trashbin.php
+++ b/apps/files_trashbin/lib/Trashbin.php
@@ -69,13 +69,6 @@ class Trashbin {
public const DEFAULTMAXSIZE = 50;
/**
- * Whether versions have already be rescanned during this PHP request
- *
- * @var bool
- */
- private static $scannedVersions = false;
-
- /**
* Ensure we don't need to scan the file during the move to trash
* by triggering the scan in the pre-hook
*
@@ -980,23 +973,6 @@ class Trashbin {
/** @var \OC\Files\Storage\Storage $storage */
[$storage,] = $view->resolvePath('/');
- //force rescan of versions, local storage may not have updated the cache
- $waitstart = time();
- while (!self::$scannedVersions) {
- try {
- $storage->getScanner()->scan('files_trashbin/versions');
- self::$scannedVersions = true;
- } catch (LockedException $e) {
- /* a concurrent remove/restore from trash occurred,
- * retry with a maximum wait time of approx. 15 seconds
- */
- if (time() - $waitstart > 15) {
- throw $e;
- }
- usleep(50000 + rand(0, 10000));
- }
- }
-
$pattern = \OC::$server->getDatabaseConnection()->escapeLikeParameter(basename($filename));
if ($timestamp) {
// fetch for old versions