Skip to content

Commit 595e27d

Browse files
fix(files_trashbin): Remove unnecessary scanner logic when getting versions from trash
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent b8cff5e commit 595e27d

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

apps/files_trashbin/lib/Trashbin.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,6 @@ class Trashbin {
6767
// unit: percentage; 50% of available disk space/quota
6868
public const DEFAULTMAXSIZE = 50;
6969

70-
/**
71-
* Whether versions have already be rescanned during this PHP request
72-
*
73-
* @var bool
74-
*/
75-
private static $scannedVersions = false;
76-
7770
/**
7871
* Ensure we don't need to scan the file during the move to trash
7972
* by triggering the scan in the pre-hook
@@ -973,23 +966,6 @@ private static function getVersionsFromTrash($filename, $timestamp, $user) {
973966
/** @var \OC\Files\Storage\Storage $storage */
974967
[$storage,] = $view->resolvePath('/');
975968

976-
//force rescan of versions, local storage may not have updated the cache
977-
$waitstart = time();
978-
while (!self::$scannedVersions) {
979-
try {
980-
$storage->getScanner()->scan('files_trashbin/versions');
981-
self::$scannedVersions = true;
982-
} catch (LockedException $e) {
983-
/* a concurrent remove/restore from trash occurred,
984-
* retry with a maximum wait time of approx. 15 seconds
985-
*/
986-
if (time() - $waitstart > 15) {
987-
throw $e;
988-
}
989-
usleep(50000 + rand(0, 10000));
990-
}
991-
}
992-
993969
$pattern = \OC::$server->getDatabaseConnection()->escapeLikeParameter(basename($filename));
994970
if ($timestamp) {
995971
// fetch for old versions

0 commit comments

Comments
 (0)