summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-02-21 07:36:43 +0100
committerGitHub <noreply@github.com>2023-02-21 07:36:43 +0100
commit98ed72b3ed7e81a75d9a323c70a5e7f5af265a23 (patch)
treea92d3ab78f2fa52969139448a8aa7c509ed97af5 /apps/files
parent93e703bbfc7c8ef654b7b0185474397ec1bbaa6b (diff)
downloadnextcloud-server-98ed72b3ed7e81a75d9a323c70a5e7f5af265a23.tar.gz
nextcloud-server-98ed72b3ed7e81a75d9a323c70a5e7f5af265a23.zip
Revert "fix(performance): Do not set up filesystem on every call"
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/appinfo/info.xml9
-rw-r--r--apps/files/composer/composer/ClassLoader.php12
-rw-r--r--apps/files/composer/composer/autoload_classmap.php1
-rw-r--r--apps/files/composer/composer/autoload_static.php1
-rw-r--r--apps/files/composer/composer/installed.php4
-rw-r--r--apps/files/lib/BackgroundJob/FileChunkCleanupJob.php62
6 files changed, 10 insertions, 79 deletions
diff --git a/apps/files/appinfo/info.xml b/apps/files/appinfo/info.xml
index e69af548d9a..1d06259074b 100644
--- a/apps/files/appinfo/info.xml
+++ b/apps/files/appinfo/info.xml
@@ -5,7 +5,7 @@
<name>Files</name>
<summary>File Management</summary>
<description>File Management</description>
- <version>1.21.2</version>
+ <version>1.21.1</version>
<licence>agpl</licence>
<author>Robin Appelman</author>
<author>Vincent Petry</author>
@@ -22,12 +22,11 @@
</dependencies>
<background-jobs>
- <job>OCA\Files\BackgroundJob\CleanupDirectEditingTokens</job>
+ <job>OCA\Files\BackgroundJob\ScanFiles</job>
+ <job>OCA\Files\BackgroundJob\DeleteOrphanedItems</job>
<job>OCA\Files\BackgroundJob\CleanupFileLocks</job>
+ <job>OCA\Files\BackgroundJob\CleanupDirectEditingTokens</job>
<job>OCA\Files\BackgroundJob\DeleteExpiredOpenLocalEditor</job>
- <job>OCA\Files\BackgroundJob\DeleteOrphanedItems</job>
- <job>OCA\Files\BackgroundJob\FileChunkCleanupJob</job>
- <job>OCA\Files\BackgroundJob\ScanFiles</job>
</background-jobs>
<commands>
diff --git a/apps/files/composer/composer/ClassLoader.php b/apps/files/composer/composer/ClassLoader.php
index a72151c77c8..fd56bd7d840 100644
--- a/apps/files/composer/composer/ClassLoader.php
+++ b/apps/files/composer/composer/ClassLoader.php
@@ -429,8 +429,7 @@ class ClassLoader
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
- $includeFile = self::$includeFile;
- $includeFile($file);
+ (self::$includeFile)($file);
return true;
}
@@ -561,10 +560,7 @@ class ClassLoader
return false;
}
- /**
- * @return void
- */
- private static function initializeIncludeClosure()
+ private static function initializeIncludeClosure(): void
{
if (self::$includeFile !== null) {
return;
@@ -578,8 +574,8 @@ class ClassLoader
* @param string $file
* @return void
*/
- self::$includeFile = \Closure::bind(static function($file) {
+ self::$includeFile = static function($file) {
include $file;
- }, null, null);
+ };
}
}
diff --git a/apps/files/composer/composer/autoload_classmap.php b/apps/files/composer/composer/autoload_classmap.php
index 642e5a1d87e..ef3480081e0 100644
--- a/apps/files/composer/composer/autoload_classmap.php
+++ b/apps/files/composer/composer/autoload_classmap.php
@@ -22,7 +22,6 @@ return array(
'OCA\\Files\\BackgroundJob\\CleanupFileLocks' => $baseDir . '/../lib/BackgroundJob/CleanupFileLocks.php',
'OCA\\Files\\BackgroundJob\\DeleteExpiredOpenLocalEditor' => $baseDir . '/../lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php',
'OCA\\Files\\BackgroundJob\\DeleteOrphanedItems' => $baseDir . '/../lib/BackgroundJob/DeleteOrphanedItems.php',
- 'OCA\\Files\\BackgroundJob\\FileChunkCleanupJob' => $baseDir . '/../lib/BackgroundJob/FileChunkCleanupJob.php',
'OCA\\Files\\BackgroundJob\\ScanFiles' => $baseDir . '/../lib/BackgroundJob/ScanFiles.php',
'OCA\\Files\\BackgroundJob\\TransferOwnership' => $baseDir . '/../lib/BackgroundJob/TransferOwnership.php',
'OCA\\Files\\Capabilities' => $baseDir . '/../lib/Capabilities.php',
diff --git a/apps/files/composer/composer/autoload_static.php b/apps/files/composer/composer/autoload_static.php
index 7287614d345..4f7872e39df 100644
--- a/apps/files/composer/composer/autoload_static.php
+++ b/apps/files/composer/composer/autoload_static.php
@@ -37,7 +37,6 @@ class ComposerStaticInitFiles
'OCA\\Files\\BackgroundJob\\CleanupFileLocks' => __DIR__ . '/..' . '/../lib/BackgroundJob/CleanupFileLocks.php',
'OCA\\Files\\BackgroundJob\\DeleteExpiredOpenLocalEditor' => __DIR__ . '/..' . '/../lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php',
'OCA\\Files\\BackgroundJob\\DeleteOrphanedItems' => __DIR__ . '/..' . '/../lib/BackgroundJob/DeleteOrphanedItems.php',
- 'OCA\\Files\\BackgroundJob\\FileChunkCleanupJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/FileChunkCleanupJob.php',
'OCA\\Files\\BackgroundJob\\ScanFiles' => __DIR__ . '/..' . '/../lib/BackgroundJob/ScanFiles.php',
'OCA\\Files\\BackgroundJob\\TransferOwnership' => __DIR__ . '/..' . '/../lib/BackgroundJob/TransferOwnership.php',
'OCA\\Files\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php',
diff --git a/apps/files/composer/composer/installed.php b/apps/files/composer/composer/installed.php
index a07f17770d4..a1f6a8636b4 100644
--- a/apps/files/composer/composer/installed.php
+++ b/apps/files/composer/composer/installed.php
@@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
- 'reference' => '3e452cfe8d80995d1657c617f887a9ee422e6ab1',
+ 'reference' => 'd51429a47232bbf46a2be832ecfa711f102da802',
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
@@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
- 'reference' => '3e452cfe8d80995d1657c617f887a9ee422e6ab1',
+ 'reference' => 'd51429a47232bbf46a2be832ecfa711f102da802',
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
diff --git a/apps/files/lib/BackgroundJob/FileChunkCleanupJob.php b/apps/files/lib/BackgroundJob/FileChunkCleanupJob.php
deleted file mode 100644
index 1c1f6f3bc99..00000000000
--- a/apps/files/lib/BackgroundJob/FileChunkCleanupJob.php
+++ /dev/null
@@ -1,62 +0,0 @@
-<?php
-declare(strict_types=1);
-
-/**
- * @copyright 2023 Anna Larch <anna.larch@gmx.net>
- *
- * @author Anna Larch <anna.larch@gmx.net>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-namespace OCA\Files\BackgroundJob;
-
-use OC\Cache\File;
-use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\BackgroundJob\Job;
-use OCP\BackgroundJob\TimedJob;
-use OCP\Files\IRootFolder;
-use OCP\IUser;
-use OCP\IUserManager;
-use Psr\Log\LoggerInterface;
-
-class FileChunkCleanupJob extends TimedJob {
- private IUserManager $userManager;
- private IRootFolder $rootFolder;
- private LoggerInterface $logger;
-
- public function __construct(IUserManager $userManager, IRootFolder $rootFolder, LoggerInterface $logger, ITimeFactory $timeFactory) {
- parent::__construct($timeFactory);
- $this->setInterval(3600*24);
- $this->setTimeSensitivity(Job::TIME_INSENSITIVE);
- $this->userManager = $userManager;
- $this->rootFolder = $rootFolder;
- $this->logger = $logger;
- }
-
- /**
- * This job cleans up all backups except the latest 3 from the updaters backup directory
- */
- public function run($argument): void {
- $this->userManager->callForSeenUsers(function (IUser $user): void {
- $this->logger->debug('Running chunk cleanup job for user '. $user->getUID());
- $fileCache = new File();
- $fileCache->setUpStorage($user->getUID());
- $fileCache->gc();
- $this->logger->debug('Finished running chunk cleanup job for user '. $user->getUID());
- });
- }
-}