From 1bbc8ef112f94532a547c8c6dddcf701d72e6f1a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20H=C3=A4rtl?= Date: Wed, 1 Feb 2023 16:43:05 +0100 Subject: [PATCH] fix(files_trashbin): Remove unnecessary scanner logic when getting versions from trash MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/files_trashbin/lib/Trashbin.php | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 72072a2588c..32488cb9103 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -67,13 +67,6 @@ class Trashbin { // unit: percentage; 50% of available disk space/quota 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 @@ -973,23 +966,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 -- 2.39.5