diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-08-06 21:30:51 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-08-06 22:05:46 +0200 |
commit | d8734b3b93d2bcc77a5eba4f0244a41b8a6b9234 (patch) | |
tree | 6c043df911016f15dfba97c03eed449f59e6eba0 /core/register_command.php | |
parent | c24f3d1336e5bf268cca2084da04ae5df4ecddb4 (diff) | |
download | nextcloud-server-d8734b3b93d2bcc77a5eba4f0244a41b8a6b9234.tar.gz nextcloud-server-d8734b3b93d2bcc77a5eba4f0244a41b8a6b9234.zip |
Add occ preview:migrate to migrate previews from the old flat structure to a subfolder structure
* `php occ preview:repair` - a preview migration tool that moves existing previews into the new location introduced with #19214
* moves `appdata_INSTANCEID/previews/FILEID` to `appdata_INSTANCEID/previews/0/5/8/4/c/e/5/FILEID`
* migration tool can be stopped during migration via `CTRL+C` - it then finishes the current folder (with the previews of one file) and stops gracefully
* if a PHP memory limit is set in the `php.ini` then it will stop automatically once it has less than 25 MiB memory left (this is to avoid hard crashes in the middle of a migration)
* the tool can be used during operation - possible drawbacks:
* there is the chance of a race condition that a new preview is generated in the moment the folder is already migrated away - so the old folder with the newly cached preview is deleted and one cached preview needs to be re-generated
* there is the chance of a race condition during access of a preview while it is migrated to the other folder - then no preview can be shown and results in a 404 (as of now this is an accepted risk)
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'core/register_command.php')
-rw-r--r-- | core/register_command.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/register_command.php b/core/register_command.php index d818423d1ab..03d458a9cbc 100644 --- a/core/register_command.php +++ b/core/register_command.php @@ -155,6 +155,8 @@ if (\OC::$server->getConfig()->getSystemValue('installed', false)) { \OC::$server->getAppManager() )); + $application->add(\OC::$server->query(\OC\Core\Command\Preview\Repair::class)); + $application->add(new OC\Core\Command\User\Add(\OC::$server->getUserManager(), \OC::$server->getGroupManager())); $application->add(new OC\Core\Command\User\Delete(\OC::$server->getUserManager())); $application->add(new OC\Core\Command\User\Disable(\OC::$server->getUserManager())); |